~kvik/ugh

6c8cdffcbb31b74008f8fa14a26d6ad524850802 — kvik 1 year, 1 month ago aa397fe
Make cfg/ configuration system
3 files changed, 10 insertions(+), 3 deletions(-)

M bin/md2html
A cfg/language
A cfg/site
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
@@ 0,0 1,1 @@
en

A cfg/site => cfg/site +1 -0
@@ 0,0 1,1 @@
ugh!