wowana.me

website source; use git clone git://wowana.me/wowana.me.git to clone this repository.


postproc (857B)


      1 #!/bin/sh
      2 
      3 filename="$1"
      4 
      5 unset iso human datepat
      6 date="$(sed <"$filename" -n '/<!--\[time / {s/.* \(.*\)]-->/\1/; p; q}')"
      7 if test -n "$date"; then
      8 	iso="$(busybox date -Iseconds -d$date)"
      9 	human="$(busybox date +'%Y %b %d' -d$date)"
     10 	datepat="s@<!--\[time.*]-->@<time datetime='$iso' title='$iso'>$human</time>@;"
     11 fi
     12 
     13 title="$(pup -p <"$filename" 'h1 text{}')"
     14 localpart="${filename#src/}"
     15 localpart="${localpart%.part.xht}.xht"
     16 
     17 if test -n "$title"; then
     18 	sed <src/header.inc "s<opal hart / wowaname<$title – wowana.me<"
     19 else
     20 	cat <src/header.inc
     21 fi |
     22 	sed \
     23 		-es%'<link rel="canonical" href="https://wowana.me/'%"&$localpart"% \
     24 		-es%'<meta http-equiv="onion-location" content="http://opalwxdqzyuwo2vbipp3facjuuztfjwauai7fghh2ggbcl7enuvfg6yd.onion/'%"&$localpart"%
     25 
     26 <"$filename" sed \
     27 	-e"1i <main>" \
     28 	-e"$datepat"'$a </main>'
     29 
     30 cat <src/footer.inc