2013-05-19 17:14:20 -04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Basic template configuration; command-line options will override
|
2013-06-04 22:50:01 -04:00
|
|
|
#
|
2015-05-16 02:14:32 -04:00
|
|
|
# Copyright (C) 2013, 2015 Mike Gerwitz
|
2013-06-04 22:50:01 -04:00
|
|
|
#
|
|
|
|
# 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/>.
|
|
|
|
# #
|
2013-05-19 17:14:20 -04:00
|
|
|
|
2013-05-25 11:09:26 -04:00
|
|
|
get-menu-docs()
|
|
|
|
{
|
2013-06-02 12:19:54 -04:00
|
|
|
# we shall only consider ordered pages---that is, those that begin with numbers; this
|
|
|
|
# allows pages to exist that are not listed in the menu
|
2013-05-25 11:09:26 -04:00
|
|
|
paths=$(
|
2015-05-16 02:14:32 -04:00
|
|
|
find "$path_root/docs" -maxdepth 1 -name '[0-9][0-9]-*.??' \
|
2013-06-02 12:19:54 -04:00
|
|
|
-exec basename {} \; \
|
2013-05-25 11:09:26 -04:00
|
|
|
| sort
|
|
|
|
)
|
|
|
|
|
|
|
|
for p in $paths; do
|
|
|
|
# we shall consider the name of the link to be the path with the extension
|
|
|
|
# and sorting prefix stripped
|
2015-05-16 02:14:32 -04:00
|
|
|
name="$( basename "${p%%.*}" )"
|
2013-05-25 11:09:26 -04:00
|
|
|
echo "${name#??-}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2013-05-19 17:14:20 -04:00
|
|
|
html_external_css=/style.css
|
|
|
|
|
2013-06-16 13:07:37 -04:00
|
|
|
# lets certain browsers---such as the proprietary mobile Safari browser that
|
|
|
|
# seems to be far too Ubiquitous---know that they should trust us with rendering
|
|
|
|
# the page to fit within the device's screen resolution
|
|
|
|
html_head='<meta name="viewport" content="initial-scale=1.0" />'
|
|
|
|
|
2013-05-25 11:09:26 -04:00
|
|
|
# menu just below the header, above the index
|
|
|
|
html_pre_index="$(
|
|
|
|
|
|
|
|
echo '<ul id="menu">'
|
|
|
|
|
|
|
|
# generate menu from the root documents
|
|
|
|
for name in `get-menu-docs`; do
|
|
|
|
# each word in the name will be capitalized and the link shall not contain
|
|
|
|
# the file extension
|
|
|
|
words=( ${name//[_-]/ } )
|
|
|
|
printf '<li><a href="/%s">%s</a></li>' "$name" "${words[*]^}"
|
|
|
|
done
|
2015-12-09 23:26:46 -05:00
|
|
|
echo '<li><a href="//social.mikegerwitz.com/"' \
|
2016-05-30 09:04:50 -04:00
|
|
|
'title="My GNU Social Instance">Social</a></li>'
|
2013-05-25 11:09:26 -04:00
|
|
|
|
2013-05-25 18:10:44 -04:00
|
|
|
# the remainder will appear below the menu, above the index
|
|
|
|
cat <<EOH
|
|
|
|
</ul>
|
|
|
|
<div id="headline">
|
2013-08-18 12:47:33 -04:00
|
|
|
<a href="https://www.eff.org/nsa-spying">
|
|
|
|
<img src="/images/eff-nsa-spying.png"
|
|
|
|
alt="NSA Spying on Americans"
|
|
|
|
title="NSA Spying on Americans" />
|
|
|
|
</a>
|
|
|
|
|
2013-05-25 18:10:44 -04:00
|
|
|
<a href="http://upgradefromwindows8.com">
|
|
|
|
<img src="/images/win8-close.png"
|
|
|
|
alt="Close Windows, Open Doors" />
|
|
|
|
</a>
|
|
|
|
</div>
|
2016-06-18 13:19:06 -04:00
|
|
|
|
|
|
|
<div id="index-headline">
|
|
|
|
<a href="https://noglobalwarrants.org">
|
|
|
|
<img src="/images/rule-41-banner4-sm.png"
|
|
|
|
alt="Stop the Changes To Rule 41"
|
|
|
|
title="Stop the Changes To Rule 41" />
|
|
|
|
</a>
|
|
|
|
</div>
|
2013-05-25 18:10:44 -04:00
|
|
|
EOH
|
2013-05-25 11:09:26 -04:00
|
|
|
)"
|
|
|
|
|
|
|
|
|
2013-05-20 06:36:18 -04:00
|
|
|
# additional content in the footer before the copyright (the awkward newline
|
|
|
|
# positions are to prevent spaces in the output)
|
2013-05-19 17:14:20 -04:00
|
|
|
html_footer=$(cat <<EOM
|
2013-06-01 23:23:09 -04:00
|
|
|
<a href="/about/inside" id="gnuinside">
|
|
|
|
<img src="/images/gnu-inside.png" alt="GNU/Linux Inside!" />
|
2013-05-19 17:14:20 -04:00
|
|
|
</a>
|
2013-05-19 22:14:12 -04:00
|
|
|
|
|
|
|
<div class="bimgs">
|
2015-11-20 23:18:54 -05:00
|
|
|
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"
|
2013-06-16 20:35:22 -04:00
|
|
|
><img src="/images/cc-bysa-88x31.png"
|
|
|
|
alt="[CC BY-SA]"
|
|
|
|
title="Creative Commons Attribution-ShareAlike"
|
|
|
|
width="88" height="31" border="0"
|
|
|
|
/></a>
|
|
|
|
|
2013-05-19 22:14:12 -04:00
|
|
|
<a href="http://www.fsf.org/register_form?referrer=5804"
|
|
|
|
><img src="/images/fsf-member.png"
|
|
|
|
alt="[FSF Associate Member]"
|
|
|
|
title="Mike Gerwitz - FSF Associate Member"
|
|
|
|
width="88" height="31" border="0"
|
|
|
|
/></a>
|
|
|
|
|
|
|
|
<a href="http://endsoftpatents.org/innovating-without-patents"
|
|
|
|
><img src="/images/esp-button.png"
|
|
|
|
alt="[ Innovating Without Patents! ]"
|
|
|
|
title="Innovating Without Patents"
|
|
|
|
width="88" 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>
|
2013-05-19 17:14:20 -04:00
|
|
|
EOM
|
|
|
|
)
|
2013-05-20 06:36:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
# index-only footer (we don't want too much spam; the other pages look much
|
|
|
|
# cleaner without this)
|
|
|
|
html_index_footer=$(cat <<EOM
|
|
|
|
<div id="selflinks">
|
2015-05-17 20:38:41 -04:00
|
|
|
<a href="https://gitlab.com/u/mikegerwitz">
|
2015-07-18 08:18:12 -04:00
|
|
|
<img src="/images/gitlab.svg"
|
2015-05-17 20:38:41 -04:00
|
|
|
alt="See me on GitLab"
|
|
|
|
title="See me on GitLab"
|
2013-05-20 06:36:18 -04:00
|
|
|
width="42" height="42" border="0"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
|
2015-05-16 02:01:09 -04:00
|
|
|
<a href="/about/githubbub">
|
2013-05-20 06:36:18 -04:00
|
|
|
<img src="/images/github-42.png"
|
2015-05-16 02:01:09 -04:00
|
|
|
alt="Don't see me on GitHub"
|
|
|
|
title="Don't see me on GitHub"
|
2013-05-20 06:36:18 -04:00
|
|
|
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>
|
2015-05-19 23:12:49 -04:00
|
|
|
|
|
|
|
<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>
|
2013-05-20 06:36:18 -04:00
|
|
|
</div>
|
|
|
|
EOM
|
|
|
|
)
|