~ecs/ecs.d2evs.net

ecs.d2evs.net/_config.sh -rw-r--r-- 935 bytes
c4d21abcEyal Sawady webring: move to bottom of page 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
title=
get_title() {
	_title="$title"
	file="$(mktemp)"
	# TODO: is this good enough?
	wersh.awk <"$1" | grep -v '^ *emit' >"$file"
	. "$file"
	rm "$file"
	printf "%s" "$title"
	title="$_title"
}

get_description() {
	# TODO: is this good enough?
	_rendering="t" wsource "$1" | escape
}

month_name() {
	case "$1" in
	01) echo "Jan" ;;
	02) echo "Feb" ;;
	03) echo "Mar" ;;
	04) echo "Apr" ;;
	05) echo "May" ;;
	06) echo "Jun" ;;
	07) echo "Jul" ;;
	08) echo "Aug" ;;
	09) echo "Sep" ;;
	10) echo "Oct" ;;
	11) echo "Nov" ;;
	12) echo "Dec" ;;
	*) echo "ERR" ;; # TODO: is this the best fallback?
	esac
}

get_date() {
	year="$(basename "$1" | cut -d- -f1)"
	month="$(basename "$1" | cut -d- -f2)"
	day="$(basename "$1" | cut -d- -f3)"
	printf "%s %s %s 00:00:00 +0000\n" "$day" "$(month_name "$month")" "$year"
}

case $input in
	*.md.w)
		preprocessor="markdown -f fencedcode -f footnote"
		wsource _templates/page.html.w
		;;
esac