Mike Gerwitz

Free Software Hacker+Activist

aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Gerwitz <mtg@gnu.org>2019-01-17 00:55:31 -0500
committerMike Gerwitz <mtg@gnu.org>2019-01-17 01:30:23 -0500
commitf24dc3e227e91e128a200f92c7c170dc45412950 (patch)
tree34ac7c31bac92230220d82643f93f5152fda9724 /src
parentf0a08f8755bd3660d24225bd0f6245de32e48198 (diff)
downloadthoughts-f24dc3e227e91e128a200f92c7c170dc45412950.zip
thoughts-f24dc3e227e91e128a200f92c7c170dc45412950.tar.gz
thoughts-f24dc3e227e91e128a200f92c7c170dc45412950.tar.bz2
cgit-root generation
This automates creation of the header and footer. Previously I modified them manually and they got out-of-sync. This is deployed to a different location on my webserver, even though the public route is `/projects'.
Diffstat (limited to 'src')
-rw-r--r--src/cgit/footer.html74
-rwxr-xr-xsrc/cgit/footer.sh27
-rw-r--r--src/cgit/header.html9
-rwxr-xr-xsrc/cgit/header.sh27
4 files changed, 54 insertions, 83 deletions
diff --git a/src/cgit/footer.html b/src/cgit/footer.html
deleted file mode 100644
index 5d0551b..0000000
--- a/src/cgit/footer.html
+++ /dev/null
@@ -1,74 +0,0 @@
-</div>
- <footer>
- <div id="rss"><a href="rss.xml">RSS</a></div>
- <hr />
- <div class="pre-copyright"> <a href="/about/inside" id="gnuinside">
- <img src="/images/gnu-inside.png" alt="GNU/Linux Inside!" />
- </a>
-
- <div class="bimgs">
- <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"
- ><img src="/images/cc-bysa-88x31.png"
- alt="[CC BY-SA]"
- title="Creative Commons Attribution-ShareAlike"
- width="88" height="31" border="0"
- /></a>
-
- <a href="http://www.fsf.org/register_form?referrer=5804"
- ><img src="/images/fsf-member.png"
- alt="[FSF Associate Member since 2007-10-31]"
- title="FSF Associate Member"
- width="125" height="31" border="0"
- /></a>
-
- <a href="http://www.defectivebydesign.org/join/button"
- ><img src="/images/elim-drm.gif"
- alt="[ Eliminate DRM! ]"
- title="Eliminate DRM!"
- width="88" height="30" border="0"
- /></a>
- </div></div>
- <div class="pre-copyright"> <div id="selflinks">
- <a href="https://gitlab.com/u/mikegerwitz">
- <img src="/images/gitlab.svg"
- alt="See me on GitLab"
- title="See me on GitLab"
- width="42" height="42" border="0"
- />
- </a>
-
- <a href="/about/githubbub">
- <img src="/images/octoright-42.png"
- alt="Don't see me on GitHub"
- title="Don't see me on GitHub"
- width="42" height="42" border="0"
- />
- </a>
-
- <a href="http://www.fsf.org/register_form?referrer=5804">
- <img src="/images/fsf-42.png"
- alt="FSF Member #5804"
- title="FSF Member #5804"
- width="42" height="42" border="0"
- />
- </a>
-
- <a href="https://savannah.gnu.org/users/mikegerwitz">
- <img src="/images/meditate-42.png"
- alt="See me on Savannah"
- title="See me on Savannah"
- width="42" height="42" border="0"
- />
- </a>
-
- <a href="https://news.ycombinator.com/user?id=mikegerwitz"
- title="mikegerwitz on Hacker News"
- class="hn-icon">HN</a>
-
- </div></div>
- <div id="copyright">
- Copyright &copy; 2012&ndash;2017 Mike Gerwitz.
- This content is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
- </div>
- <div>Output generated by cgit</div>
- </footer>
diff --git a/src/cgit/footer.sh b/src/cgit/footer.sh
new file mode 100755
index 0000000..c1e6d75
--- /dev/null
+++ b/src/cgit/footer.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Extracts relevant portion of footer for cgit
+#
+# Copyright (C) 2019 Mike Gerwitz
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+##
+
+set -euo pipefail
+
+main()
+{
+ awk 'NR==1,/<\/footer>/{ print }' < src/footer.tpl.htm
+}
+
+main "$@"
diff --git a/src/cgit/header.html b/src/cgit/header.html
deleted file mode 100644
index 6b95375..0000000
--- a/src/cgit/header.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
-<div class="body-index no-sidebar">
- <header>
- <h1 class="title"><a href="http://mikegerwitz.com">Mike Gerwitz</a></h1>
- <h2 class="desc">Free Software Hacker+Activist</h2>
- </header>
- <ul id="menu">
-<li><a href="/about">About</a></li><li><a href="/projects">Projects</a></li><li><a href="/papers">Papers</a></li><li><a href="/talks">Talks</a></li><li><a href="//social.mikegerwitz.com/" title="My GNU Social Instance">Social</a></li>
- </ul>
diff --git a/src/cgit/header.sh b/src/cgit/header.sh
new file mode 100755
index 0000000..62eb30c
--- /dev/null
+++ b/src/cgit/header.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Extracts relevant portion of header for cgit
+#
+# Copyright (C) 2019 Mike Gerwitz
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+##
+
+set -euo pipefail
+
+main()
+{
+ awk '/<header>/,/<main>/{ print }' < <( src/mkheader projects )
+}
+
+main "$@"