From 30f00fa694280a7eaa23c20affba22bd14b91739 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 2 Jul 2022 18:06:13 +0300 Subject: refactor the HTML extras sub-directory --- lib/html.source.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/html.source.sh') diff --git a/lib/html.source.sh b/lib/html.source.sh index d55067d..125b174 100644 --- a/lib/html.source.sh +++ b/lib/html.source.sh @@ -69,6 +69,27 @@ html::process_inline () { html::process_inline_code } +html::add_extras () { + local -r html_base_dir="$CONTENT_BASE_DIR/html" + cp "$HTML_CSS_STYLE" "$html_base_dir/style.css" + + find "$html_base_dir" -mindepth 1 -maxdepth 1 -type d | $GREP -E -v '(\.git)' | + while read section_dir; do + local override_source="./extras/html/style-$(basename $section_dir)-override.css" + local override_dest="$section_dir/style-override.css" + if [ ! -f "$override_source" ]; then + touch "$override_dest" # Empty override + else + cp "$override_source" "$override_dest" + fi + done + + cp "$HTML_WEBFONT_TEXT" "$html_base_dir/text.ttf" + cp "$HTML_WEBFONT_CODE" "$html_base_dir/code.ttf" + cp "$HTML_WEBFONT_HANDNOTES" "$html_base_dir/handnotes.ttf" + cp "$HTML_WEBFONT_TYPEWRITER" "$html_base_dir/typewriter.ttf" +} + # Convert Gemtext to HTML html::fromgmi () { local is_list=no -- cgit v1.2.3