contrib/html.sh: link the stylesheet from top level...

... and copy it there in Makefile.
This commit is contained in:
Christian Hesse 2025-10-30 10:19:30 +01:00
parent a5ac5138be
commit a4d4365735
3 changed files with 7 additions and 3 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@
*.rej
# html files (as generated from markdown)
style.css
*.html
# checksums file as used by $ScriptInstallUpdate

View file

@ -7,11 +7,14 @@ LOCAL = $(wildcard *.local.rsc)
WIFI = $(wildcard *.wifi.rsc)
MARKDOWN = $(wildcard *.md doc/*.md doc/mod/*.md)
HTML = $(MARKDOWN:.md=.html)
HTML = $(MARKDOWN:.md=.html) style.css
all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json
%.html: %.md contrib/html.sh contrib/html.sh.d/head.html
style.css: contrib/general/style.css
cp $< $@
%.html: %.md style.css contrib/html.sh contrib/html.sh.d/head.html
contrib/html.sh $< > $@
%.capsman.rsc: %.template.rsc Makefile

View file

@ -5,7 +5,7 @@ set -e
RELTO="$(dirname "${1}")"
sed \
-e "s|__TITLE__|$(head -n1 "${1}")|" \
-e "s|__STYLE__|$(realpath --relative-to="${RELTO}" contrib/general/style.css)|" \
-e "s|__STYLE__|$(realpath --relative-to="${RELTO}" style.css)|" \
< "${0}.d/head.html"
markdown -f toc,idanchor "${1}" | sed \
-e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \