author | Alan Dipert
<alan@dipert.org> 2025-10-08 05:25:14 UTC |
committer | Alan Dipert
<alan@dipert.org> 2025-10-08 05:25:14 UTC |
parent | 95bd84328562bfa0ff413a8a7eb49ef5832e571c |
Makefile | +4 | -3 |
tools/gen_index.sh | +2 | -2 |
tpl/head.html | +2 | -2 |
diff --git a/Makefile b/Makefile index 4566487..d6f8488 100644 --- a/Makefile +++ b/Makefile @@ -27,13 +27,13 @@ $(OUT)/%.html: $(SRC)/%.md $(HEAD) $(FOOT) tools/mdlink2html.awk $(BUILDINFO) | @mkdir -p $(@D) @awk -f tools/mdlink2html.awk $< > $@.rewritten.md @$(MD2HTML) $(CMARK_FLAGS) $@.rewritten.md > $@.body.html - @css_prefix="$$(dirname "$@" | sed -e 's#^$(OUT)##' -e 's#^/##' -e 's#[^/][^/]*#../#g')"; \ + @root_prefix="$$(dirname "$@" | sed -e 's#^$(OUT)##' -e 's#^/##' -e 's#[^/][^/]*#../#g')"; \ page_title=$$(basename "$<" .md); \ build_info=$$($(BUILDINFO)); \ build_info_esc=$$(printf '%s\n' "$$build_info" | sed 's/[\\/\&]/\\&/g'); \ page_title_esc=$$(printf '%s\n' "$$page_title" | sed 's/[\\/\&]/\\&/g'); \ - sed -e "s|@CSS@|$${css_prefix}|g" -e "s|@BUILDINFO@|$${build_info_esc}|g" -e "s|@TITLE@|$${page_title_esc}|g" $(HEAD) > $@.head.html; \ - sed -e "s|@CSS@|$${css_prefix}|g" -e "s|@BUILDINFO@|$${build_info_esc}|g" -e "s|@TITLE@|$${page_title_esc}|g" $(FOOT) > $@.foot.html; \ + sed -e "s|@ROOT@|$${root_prefix}|g" -e "s|@BUILDINFO@|$${build_info_esc}|g" -e "s|@TITLE@|$${page_title_esc}|g" $(HEAD) > $@.head.html; \ + sed -e "s|@ROOT@|$${root_prefix}|g" -e "s|@BUILDINFO@|$${build_info_esc}|g" -e "s|@TITLE@|$${page_title_esc}|g" $(FOOT) > $@.foot.html; \ cat $@.head.html $@.body.html $@.foot.html > $@; \ rm -f $@.head.html $@.foot.html @rm -f $@.rewritten.md $@.body.html @@ -51,6 +51,7 @@ deploy: check-git-clean assets all exit 1; \ fi rsync -a --chmod=F644,D755 $(OUT)/ $(DEPLOY_HOST) + git push tree: printf 'Markdown sources: ' && find $(SRC) -type f -name '*.md' | wc -l diff --git a/tools/gen_index.sh b/tools/gen_index.sh index cf934c2..fa0440c 100755 --- a/tools/gen_index.sh +++ b/tools/gen_index.sh @@ -16,12 +16,12 @@ head_tmp=$(mktemp) foot_tmp=$(mktemp) body_tmp=$(mktemp) -sed -e "s|@CSS@|$css_prefix|g" \ +sed -e "s|@ROOT@|$css_prefix|g" \ -e "s|@BUILDINFO@|$build_info_esc|g" \ -e "s|@TITLE@|$page_title|g" \ tpl/head.html > "$head_tmp" -sed -e "s|@CSS@|$css_prefix|g" \ +sed -e "s|@ROOT@|$css_prefix|g" \ -e "s|@BUILDINFO@|$build_info_esc|g" \ -e "s|@TITLE@|$page_title|g" \ tpl/foot.html > "$foot_tmp" diff --git a/tpl/head.html b/tpl/head.html index d7ab577..af2dc00 100644 --- a/tpl/head.html +++ b/tpl/head.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>@TITLE@</title> - <link rel="stylesheet" href="@CSS@style.css"> + <link rel="stylesheet" href="@ROOT@style.css"> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XCMVL5K44X"></script> <script> window.dataLayer = window.dataLayer || []; @@ -16,7 +16,7 @@ <body> <div id="main"> <header class="site-head"> - <h1><a href="@CSS@Home.html">Home</a></h1> + <h1><a href="@ROOT@Home.html">Home</a></h1> </header> <div class="pages"> <div class="content">