M bin/md2html => bin/md2html +8 -3
@@ 14,12 14,17 @@ fn expand {
ENDOFTEMPLATE'
}
-# Template variables
-# TODO: Source these from templates/env or something.
-language = 'en'
+fn cfg {
+ echo -n `''{sed 1q cfg/$1 >[2]/dev/null}
+}
+
+language = `{cfg language}
+site = `{cfg site}
stub = `{echo $md | sed 's@\..*$@@'}
title = `{sed 's@^# @@; 1q' $stub.md}
+if(! ~ $#site 0)
+ title = $site — $title
head = `''{expand templates/head.html}
body = `''{bin/filter-markdown $stub.md}
body = `''{expand templates/body.html}
A cfg/language => cfg/language +1 -0
A cfg/site => cfg/site +1 -0