commit - f6a3556cd158db6aaa0937210fd9c6413fd6c8c8
commit + c8477a004f79c72afc1a7f965b169cf639d0a1f9
blob - 966812fe783e97e2aa1a1679d3c83bcfd68506c0
blob + cb5d800807a3f1b81e1ea558a365f4cb9847e5c4
--- site/Makefile
+++ site/Makefile
SUBST_GEM = ./subst MANEXT=txt EXT=gmi
SUBST_WWW = ./subst MANEXT=html EXT=html
-.PHONY: all dirs manpages server-www serve-gemini upload clean
+.PHONY: all dirs manpages server-www serve-gemini upload clean titles
all: dirs manpages pages
cp style.css www/
${SUBST_GEM} $p > gemini/$p
${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/${p:.gmi=.html}
+ ${MAKE} titles | ./menu.pl "${p:.gmi=.html}" >> www/${p:.gmi=.html}
${SUBST_WWW} $p | ./gem2html >> www/${p:.gmi=.html}
cat footer.html >> www/${p:.gmi=.html}
.endfor
clean:
rm -rf gemini www
+
+titles:
+.for p in ${PAGES}
+ @printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
+.endfor
blob - /dev/null
blob + 640631631833f16a211ed0206a8e1a6d557a8afe (mode 755)
--- /dev/null
+++ site/menu.pl
+#!/usr/bin/env perl
+
+use v5.10;
+use strict;
+use warnings;
+
+my $page = shift or die 'missing page';
+my @pages = ();
+
+while (<>) {
+ chomp;
+ @pages = (@pages, $_);
+}
+
+my $did = 0;
+for (@pages) {
+ if (!$did) {
+ $did = 1;
+ } else {
+ print "| ";
+ }
+
+ my ($href, $text) = m/^([^\s]*)\s*(.*)$/;
+ if ($href eq $page) {
+ print "<strong>$text</strong> ";
+ } else {
+ print "<a href='$href'>$text</a> ";
+ }
+}
+
+say "";