aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Carlson <thecarlsondaddy@gmail.com>2017-03-07 07:44:31 -0500
committerAndy Carlson <thecarlsondaddy@gmail.com>2017-03-07 07:44:31 -0500
commit7826aadf16aae1bc5a98cb615838fae32f25e412 (patch)
treebe78014796d911833e3be6e1c65017f28bcd79ee
parenta5a10272a775f92d4f314991ad3928102175afd0 (diff)
initial commit
-rwxr-xr-xcgi-bin/sitemap.sh30
-rwxr-xr-xedit.sh26
-rw-r--r--leftnav.xsl247
-rw-r--r--site.m419
-rw-r--r--topnav.xsl304
5 files changed, 626 insertions, 0 deletions
diff --git a/cgi-bin/sitemap.sh b/cgi-bin/sitemap.sh
new file mode 100755
index 0000000..a51e75b
--- /dev/null
+++ b/cgi-bin/sitemap.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+BASEURL="http://www.andydoestech.com"
+
+echo "Content-type: application/xml"
+echo ""
+
+cat << XMLHEAD
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+XMLHEAD
+
+SITEMOD=$(date -u -d "$(stat ../site.xml | grep '^Modify' | sed 's/^Modify: //g;s/\.[0-9]*//g')" +"%Y-%m-%dT%H:%M:%S+00:00")
+
+echo "<url>"
+echo "<loc>$BASEURL/</loc>"
+echo "<lastmod>$SITEMOD</lastmod>"
+echo "<changefreq>weekly</changefreq>"
+echo "<priority>0.6</priority>"
+echo "</url>"
+
+cat ../site.xml | grep -A1 '<page>' | grep '<label>' | sed 's/^[ \t]*//g;s/<[\/]*[a-zA-Z0-9]*>//g' | while read line; do
+ echo "<url>"
+ echo "<loc>$BASEURL/$line</loc>"
+ echo "<lastmod>$SITEMOD</lastmod>"
+ echo "<changefreq>weekly</changefreq>"
+ echo "<priority>0.6</priority>"
+ echo "</url>"
+done
+echo "</urlset>"
diff --git a/edit.sh b/edit.sh
new file mode 100755
index 0000000..02de08c
--- /dev/null
+++ b/edit.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+getpage() {
+ # open fd
+ exec 3>&1
+
+ # Store data to $VALUES variable
+ VALUES=$(dialog --ok-label "Submit" \
+ --backtitle "Linux User Managment" \
+ --title "Useradd" \
+ --form "Create a new user" \
+ 15 50 0 \
+ "Title:" 1 1 "$user" 1 10 10 0 \
+ "Label:" 2 1 "$shell" 2 10 15 0 \
+ "Content:" 3 1 "$groups" 3 10 8 0 \
+ 2>&1 1>&3)
+
+ # close fd
+ exec 3>&-
+
+ # display values just entered
+ TITLE=$(echo "$VALUES" | head -n1)
+ LABEL=$(echo "$VALUES" | head -n2 | tail -n1)
+ CONTENT=$(echo "$VALUES" | head -n3 | tail -n1)
+
+}
diff --git a/leftnav.xsl b/leftnav.xsl
new file mode 100644
index 0000000..8a6d27b
--- /dev/null
+++ b/leftnav.xsl
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output />
+<xsl:template match="/">
+<html>
+<head>
+ <title><xsl:value-of select="site/title" /></title>
+ <script type="text/javascript" src="assets/js/jquery-3.1.1.min.js"></script>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $('article.page').hide();
+
+ $('.navitem').click(function() {
+ $('article.homepage').hide();
+ $('article.page').hide();
+ $("article#" + $(this).attr('id')).fadeIn();
+ $(document).prop('title',$(this).text());
+ $('html').animate({scrollTop:0},'fast');
+ });
+
+ $('.homenav').click(function() {
+ $('article.page').hide();
+ $('article.homepage').fadeIn();
+ $(document).prop('title',$('h1#pageheader').text());
+ $('html').animate({scrollTop:0},'fast');
+ });
+
+ if (location.hash == "") {
+ $('a#homepage').click();
+ }
+ else {
+ $('a' + (location.hash)).click();
+ }
+ });
+ </script>
+ <style>
+ div.container {
+ border-radius: 25px;
+ width: 90%;
+ border: 1px solid gray;
+ margin: auto;
+ }
+
+ div header {
+ border-top-left-radius: 25px;
+ border-top-right-radius: 25px;
+ }
+
+ div footer {
+ border-bottom-left-radius: 25px;
+ border-bottom-right-radius: 25px;
+ }
+
+ div header, div footer {
+ padding: 1em;
+ color: white;
+ background-color: <xsl:for-each select="site">
+ <xsl:choose>
+ <xsl:when test="theme='blue'">#0000dd</xsl:when>
+ <xsl:when test="theme='green'">#00cc00</xsl:when>
+ <xsl:when test="theme='red'">#dd0000</xsl:when>
+ <xsl:when test="theme='purple'">#800080</xsl:when>
+ <xsl:when test="theme='gray'">#666666</xsl:when>
+ <xsl:otherwise><xsl:value-of select="theme" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>;
+ clear: left;
+ text-align: center;
+ }
+
+ footer a {
+ color: white;
+ text-decoration: none;
+ }
+
+ footer span {
+ display: inline-block;
+ width: 20px;
+ }
+
+ footer p {
+ font-size: 10pt;
+ }
+
+ belowpage {
+ padding-top: 30px;
+ display: flex;
+ margin:auto;
+ width: 300px;
+ }
+
+ belowpage div {
+ text-align: center;
+ width: 100px;
+ }
+
+ belowpage div a {
+ text-decoration: none;
+ color: #000000;
+ }
+
+ belowpage div.left {
+ float: left;
+ }
+
+ belowpage div.right {
+ float: right;
+ }
+
+ nav {
+ float: left;
+ max-width: 20%;
+ margin: 0;
+ padding: 1em;
+ }
+
+ nav ul {
+ list-style-type: none;
+ padding: 0;
+ }
+
+ nav ul li {
+ margin:3px;
+ }
+
+ nav ul li:hover {
+ background-color: <xsl:for-each select="site">
+ <xsl:choose>
+ <xsl:when test="theme='blue'">#8888dd</xsl:when>
+ <xsl:when test="theme='green'">#88cc88</xsl:when>
+ <xsl:when test="theme='red'">#dd8888</xsl:when>
+ <xsl:when test="theme='purple'">#9370DB</xsl:when>
+ <xsl:when test="theme='gray'">#999999</xsl:when>
+ <xsl:otherwise><xsl:value-of select="theme" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>;
+ }
+
+ nav ul a {
+ color: #000000;
+ text-decoration: none;
+ }
+
+ nav ul a:hover {
+ color: #ffffff;
+ }
+
+ content {
+ float: left;
+ left: 190px;
+ border-left: 0px solid gray;
+ padding: 1em;
+ overflow: hidden;
+ width:80%;
+ }
+
+ article {
+ display: none;
+ }
+
+ iframe {
+ border-width: 0px;
+ }
+
+ section div.image-right {
+ float: right;
+ }
+
+ section div.image-left {
+ float: left;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="container">
+ <header>
+ <h1 id="pageheader"><xsl:value-of select="site/title" /></h1>
+ </header>
+ <nav>
+ <ul>
+ <li><a href="#homepage" id="homepage" class="homenav">Home</a></li>
+ <xsl:for-each select="site/page">
+ <li><a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#',label)"/>
+ </xsl:attribute>
+ <xsl:attribute name="id">
+ <xsl:value-of select="label"/>
+ </xsl:attribute>
+ <xsl:attribute name="class">navitem</xsl:attribute>
+ <xsl:value-of select="title" />
+ </a></li>
+ </xsl:for-each>
+ </ul>
+ <xsl:for-each select="site/subpage">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#',label)"/>
+ </xsl:attribute>
+ <xsl:attribute name="style">display:none;</xsl:attribute>
+ <xsl:attribute name="id">
+ <xsl:value-of select="label"/>
+ </xsl:attribute>
+ <xsl:attribute name="class">navitem</xsl:attribute>
+ <xsl:value-of select="title" />
+ </a>
+ </xsl:for-each>
+ </nav>
+ <content>
+ <xsl:for-each select="site/homepage">
+ <article>
+ <xsl:attribute name="class">homepage</xsl:attribute>
+ <xsl:copy-of select="section" />
+ </article>
+ </xsl:for-each>
+ <xsl:for-each select="site/page">
+ <article>
+ <xsl:attribute name="class">page</xsl:attribute>
+ <xsl:attribute name="id"><xsl:value-of select="label" /></xsl:attribute>
+ <xsl:copy-of select="section" />
+ </article>
+ </xsl:for-each>
+ <xsl:for-each select="site/subpage">
+ <article>
+ <xsl:attribute name="class">page</xsl:attribute>
+ <xsl:attribute name="id"><xsl:value-of select="label" /></xsl:attribute>
+ <xsl:copy-of select="section" />
+ </article>
+ </xsl:for-each>
+ </content>
+ <xsl:copy-of select="site/footer" />
+ </div>
+ <xsl:copy-of select="site/belowpage" />
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-50366970-3', 'auto');
+ ga('send', 'pageview');
+
+ </script>
+ </body>
+</html>
+</xsl:template>
+</xsl:stylesheet>
diff --git a/site.m4 b/site.m4
new file mode 100644
index 0000000..a104c7d
--- /dev/null
+++ b/site.m4
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="STYLESHEET"?>
+<site>
+ <title>SITETITLE</title>
+ <header>HEADERTEXT</header>
+ <theme>THEME</theme>
+ <footer>
+ FOOTERHTML
+ </footer>
+ <belowpage>
+ BELOWPAGEHTML
+ </belowpage>
+ <homepage>
+ <section>
+ HOMEPAGEHTML
+ </section>
+ </homepage>
+ PAGEOBJECTS
+</site>
diff --git a/topnav.xsl b/topnav.xsl
new file mode 100644
index 0000000..7faa73c
--- /dev/null
+++ b/topnav.xsl
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!-- SET BASE URL HERE -->
+<xsl:variable name="baseurl" select="'http://www.andydoestech.com'" />
+<!-- EDIT NOTHING BELOW HERE -->
+<xsl:param name="qs-sitemap" />
+<xsl:output />
+<xsl:template match="/">
+<html>
+<head>
+ <title><xsl:value-of select="site/title" /></title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <script type="text/javascript" src="assets/js/jquery-3.1.1.min.js"></script>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $('article.page').hide();
+
+ $('.navitem').click(function() {
+ $('article.homepage').hide();
+ $('article.page').hide();
+ $("article#" + $(this).attr('id')).fadeIn();
+ $(document).prop('title',$(this).text());
+ $('html').animate({scrollTop:0},'fast');
+ });
+
+ $('.homenav').click(function() {
+ $('article.page').hide();
+ $('article.homepage').fadeIn();
+ $(document).prop('title',$('div.hptitle').text());
+ $('html').animate({scrollTop:0},'fast');
+ });
+
+ if (location.hash == "") {
+ $('a#homepage').click();
+ }
+ else {
+ $('a' + (location.hash)).click();
+ }
+ });
+ </script>
+ <style>
+ div.container {
+ border-radius: 25px;
+ width: 90%;
+ border: 1px solid gray;
+ margin: auto;
+ }
+
+ div header {
+ border-top-left-radius: 25px;
+ border-top-right-radius: 25px;
+ }
+
+ div footer {
+ border-bottom-left-radius: 25px;
+ border-bottom-right-radius: 25px;
+ }
+
+ div header, div footer {
+ padding: 1em;
+ color: white;
+ background-color: <xsl:for-each select="site">
+ <xsl:choose>
+ <xsl:when test="theme='blue'">#0000dd</xsl:when>
+ <xsl:when test="theme='green'">#00cc00</xsl:when>
+ <xsl:when test="theme='red'">#dd0000</xsl:when>
+ <xsl:when test="theme='purple'">#800080</xsl:when>
+ <xsl:when test="theme='gray'">#666666</xsl:when>
+ <xsl:otherwise><xsl:value-of select="theme" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>;
+ clear: left;
+ text-align: center;
+ }
+
+ div.hptitle {
+ display: none;
+ }
+
+ footer a {
+ color: white;
+ text-decoration: none;
+ }
+
+ footer span {
+ display: inline-block;
+ width: 20px;
+ }
+
+ footer p {
+ font-size: 10pt;
+ }
+
+ belowpage {
+ padding-top: 30px;
+ display: flex;
+ margin:auto;
+ width: 300px;
+ }
+
+ belowpage div {
+ text-align: center;
+ width: 100px;
+ }
+
+ belowpage div a {
+ text-decoration: none;
+ color: #000000;
+ }
+
+ belowpage div.left {
+ float: left;
+ }
+
+ belowpage div.right {
+ float: right;
+ }
+
+ nav {
+ text-align:center;
+ }
+
+ nav ul {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+ background-color: <xsl:for-each select="site">
+ <xsl:choose>
+ <xsl:when test="theme='blue'">#0000dd</xsl:when>
+ <xsl:when test="theme='green'">#00cc00</xsl:when>
+ <xsl:when test="theme='red'">#dd0000</xsl:when>
+ <xsl:when test="theme='purple'">#800080</xsl:when>
+ <xsl:when test="theme='gray'">#666666</xsl:when>
+ <xsl:otherwise><xsl:value-of select="theme" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>;
+ }
+
+ nav ul li {
+ float:left;
+ }
+
+ nav ul li a {
+ display: block;
+ color: white;
+ text-align: center;
+ padding: 14px 16px;
+ text-decoration: none;
+ }
+
+ nav ul li a:hover {
+ background-color: <xsl:for-each select="site">
+ <xsl:choose>
+ <xsl:when test="theme='blue'">#8888dd</xsl:when>
+ <xsl:when test="theme='green'">#88cc88</xsl:when>
+ <xsl:when test="theme='red'">#dd8888</xsl:when>
+ <xsl:when test="theme='purple'">#9370DB</xsl:when>
+ <xsl:when test="theme='gray'">#999999</xsl:when>
+ <xsl:otherwise><xsl:value-of select="theme" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>;
+ }
+
+ nav ul a {
+ color: #000000;
+ text-decoration: none;
+ }
+
+ nav ul a:hover {
+ color: #ffffff;
+ }
+
+ content {
+ float: left;
+ left: 190px;
+ border-left: 0px solid gray;
+ padding: 1em;
+ overflow: hidden;
+ width:95%;
+ }
+
+ article {
+ display: none;
+ }
+
+ iframe {
+ border-width: 0px;
+ }
+
+ section div.image-right {
+ float: right;
+ }
+
+ section div.image-left {
+ float: left;
+ }
+
+ form div {
+ top:20px;
+ }
+
+ form div span.fieldlabel {
+ left:0px;
+ top:0px;
+ }
+
+ form div input {
+ display:block;
+ position:relative;
+ left:0px;
+ top:0px;
+ }
+
+ form div textarea {
+ display:block;
+ position:relative;
+ left:0px;
+ top:0px;
+ }
+
+ form div select {
+ display:block;
+ position:relative;
+ left:0px;
+ top:0px;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="container">
+ <header>
+ <h1 id="pageheader"><xsl:value-of select="site/header" /></h1>
+ </header>
+ <nav>
+ <ul>
+ <li><a href="#homepage" id="homepage" class="homenav">Home</a></li>
+ <xsl:for-each select="site/page">
+ <li><a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#',label)"/>
+ </xsl:attribute>
+ <xsl:attribute name="id">
+ <xsl:value-of select="label"/>
+ </xsl:attribute>
+ <xsl:attribute name="class">navitem</xsl:attribute>
+ <xsl:value-of select="title" />
+ </a></li>
+ </xsl:for-each>
+ </ul>
+ <xsl:for-each select="site/subpage">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#',label)"/>
+ </xsl:attribute>
+ <xsl:attribute name="style">display:none;</xsl:attribute>
+ <xsl:attribute name="id">
+ <xsl:value-of select="label"/>
+ </xsl:attribute>
+ <xsl:attribute name="class">navitem</xsl:attribute>
+ <xsl:value-of select="title" />
+ </a>
+ </xsl:for-each>
+ </nav>
+ <content>
+ <xsl:for-each select="site/homepage">
+ <article>
+ <xsl:attribute name="class">homepage</xsl:attribute>
+ <xsl:copy-of select="section" />
+ </article>
+ </xsl:for-each>
+ <xsl:for-each select="site/page">
+ <article>
+ <xsl:attribute name="class">page</xsl:attribute>
+ <xsl:attribute name="id"><xsl:value-of select="label" /></xsl:attribute>
+ <xsl:copy-of select="section" />
+ </article>
+ </xsl:for-each>
+ <xsl:for-each select="site/subpage">
+ <article>
+ <xsl:attribute name="class">page</xsl:attribute>
+ <xsl:attribute name="id"><xsl:value-of select="label" /></xsl:attribute>
+ <xsl:copy-of select="section" />
+ </article>
+ </xsl:for-each>
+ </content>
+ <xsl:copy-of select="site/footer" />
+ </div>
+ <div class="hptitle"><xsl:value-of select="site/title" /></div>
+ <xsl:copy-of select="site/belowpage" />
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-50366970-3', 'auto');
+ ga('send', 'pageview');
+
+ </script>
+ </body>
+</html>
+</xsl:template>
+</xsl:stylesheet>