contrib/html.sh: include stylesheet via link

This commit is contained in:
Christian Hesse 2025-10-29 14:46:01 +01:00
parent 4b8e8adb2d
commit a5ac5138be
3 changed files with 38 additions and 11 deletions

View file

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