thoughts/tpl/.config

121 lines
3.1 KiB
Bash

#!/bin/bash
#
# Basic template configuration; command-line options will override
get-menu-docs()
{
paths=$(
find "$path_root/docs" -maxdepth 1 -name '*.pg' -exec basename {} \; \
| 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
name="$( basename "${p%%.pg}" )"
echo "${name#??-}"
done
}
html_external_css=/style.css
# 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
# the remainder will appear below the menu, above the index
cat <<EOH
</ul>
<div id="headline">
<a href="http://upgradefromwindows8.com">
<img src="/images/win8-close.png"
alt="Close Windows, Open Doors" />
</a>
<a href="http://defectivebydesign.org/no-drm-in-html5">
<img src="/images/hollywebshare.jpg"
alt="Stop the Hollyweb! No DRM in HTML5." />
</a>
<a href="http://windows7sins.org">
<img src="/images/win7sins.png"
alt="Windows 7 Sins" title="Windows 7 Sins" />
</a>
</div>
EOH
)"
# additional content in the footer before the copyright (the awkward newline
# positions are to prevent spaces in the output)
html_footer=$(cat <<EOM
<a href="/about/inside" id="gnuinside">
<img src="/images/gnu-inside.png" alt="GNU/Linux Inside!" />
</a>
<div class="bimgs">
<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>
EOM
)
# 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">
<a href="http://gitorious.org/~mikegerwitz">
<img src="/images/gitorious-42.png"
alt="See me on Gitorious"
title="See me on Gitorious"
width="42" height="42" border="0"
/>
</a>
<a href="http://github.com/mikegerwitz">
<img src="/images/github-42.png"
alt="See me on GitHub"
title="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>
</div>
EOM
)