thoughts/tpl/.config

103 lines
2.6 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#
# Basic template configuration; command-line options will override
2013-05-25 11:09:26 -04:00
get-menu-docs()
{
paths=$(
find "$path_root/docs" -maxdepth 1 -name '*.htm?' -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%%.htm?}" )"
echo "${name#??-}"
done
}
html_external_css=/style.css
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
echo '</ul>'
)"
# 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/gnulinuxinside.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
)