zodiac/bin/zod_render

33 lines
721 B
Plaintext
Raw Normal View History

#!/bin/sh
# render a zodiac page
2011-10-18 07:07:12 +02:00
# zod_render zodlibdir projdir targetdir md_builtin [files]
2011-10-06 23:52:34 +02:00
zod_lib="$1"
proj="$2"
target="$3"
2011-10-18 07:07:12 +02:00
md_builtin="$4"
f="$5"
2011-10-18 07:07:12 +02:00
# source zod sh functions
. $zod_lib/zod_functions
ext=${f##*.}
2011-10-18 07:07:12 +02:00
meta=${f%.$ext}.meta
set -- -f "$zod_lib/render.awk"
[ -f "$proj/helpers.awk" ] && set -- "$@" -f "$proj/helpers.awk"
set -- "$@" -v markdown_filter_cmd="$md_builtin"
[ -f "$proj/global.meta" ] && set -- "$@" $proj/global.meta
[ -f "$meta" ] && set -- "$@" $meta
set -- "$@" "$f"
find "$proj" -type f -name "*.partial" -o -name "*.layout"
while read -r part; do
set -- "$@" "$part"
done
2011-10-18 07:07:12 +02:00
page=${f##*/}
page=${page%.$ext}.html
__zod_destination "$proj" "$target" "$f"
awk "$@" > "$destination/$page"