aboutsummaryrefslogtreecommitdiff
path: root/v2/src/development/genhtml.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-04-04 17:53:27 -0300
committerEuAndreh <eu@euandre.org>2023-04-04 17:53:27 -0300
commit6b7d170738b4beac4223c9a29255a9044b63bf76 (patch)
tree81c6400b440f4a135b1fa5fd7ffcf00c9bc48880 /v2/src/development/genhtml.sh
parentv2: git mv src/development/getconf.sh src/development/genconf.sh (diff)
downloadeuandre.org-6b7d170738b4beac4223c9a29255a9044b63bf76.tar.gz
euandre.org-6b7d170738b4beac4223c9a29255a9044b63bf76.tar.xz
v2: Recove h[2-6] anchor link and icon
Diffstat (limited to '')
-rwxr-xr-xv2/src/development/genhtml.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/v2/src/development/genhtml.sh b/v2/src/development/genhtml.sh
index f3a6e3a..1b2718a 100755
--- a/v2/src/development/genhtml.sh
+++ b/v2/src/development/genhtml.sh
@@ -192,19 +192,20 @@ add_headings_anchors() {
(
IFS=''
while read -r line; do
- if ! printf '%s' "$line" | grep -q '^<h[2-6]>'; then
+ if ! printf '%s' "$line" | grep -q "^$INDENT<h[2-6]>"; then
printf '%s\n' "$line"
continue
fi
- LVL="$(printf '%s' "$line" | sed 's|^<h\(.\)>.*|\1|')"
- HEADING="$(printf '%s' "$line" | sed 's|^<h.>\(.*\)</h.>$|\1|')"
+ LVL="$(printf '%s' "$line" | sed "s|^$INDENT<h\(.\)>.*|\1|")"
+ HEADING="$(printf '%s' "$line" | sed "s|^$INDENT<h.>\(.*\)</h.>$|\1|")"
SLUG="$(slugify_once "$HEADING")"
- printf '<h%s class="header-anchor" id="%s">%s<a href="#%s" aria-hidden="true"><img class="svg-icon" src="%s" /></a></h%s>\n' \
+ printf '%s<h%s class="header-anchor" id="%s">%s<a href="#%s" aria-hidden="true"><img class="svg-icon" src="%s" /></a></h%s>\n' \
+ "$INDENT" \
"$LVL" \
"$SLUG" \
"$HEADING" \
"$SLUG" \
- "$(url-for 'static/link.svg')" \
+ "${icon_link_url:?}" \
"$LVL"
done
)