Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks / create-header-anchors.awk
diff options
context:
space:
mode:
Commit0187e255a811bebb0dad3624f2c6d78b829d15c5 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-01-17 16:15:28 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-01-17 16:15:28 +0200
Files68efd3520e72c8c8c553fdda7b9391d9ec4e9feb /generate-hooks/create-header-anchors.awk
syndamia.com-0187e255a811bebb0dad3624f2c6d78b829d15c5.tar
syndamia.com-0187e255a811bebb0dad3624f2c6d78b829d15c5.tar.gz
syndamia.com-0187e255a811bebb0dad3624f2c6d78b829d15c5.zip
Parentda000c477625bb533688df84bd95ba3a3aff3246 (diff)
[awk] Reworked generation to happen via a combined script, updated scripts and added info in scripts readme
1 files changed, 0 insertions, 16 deletions
-rw-r--r--generate-hooks/create-header-anchors.awk16
diff --git a/generate-hooks/create-header-anchors.awk b/generate-hooks/create-header-anchors.awk
deleted file mode 100644
index f6d2815..0000000
--- a/generate-hooks/create-header-anchors.awk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# == About ==
-#
-# ssg generates an id for every heading. That's why after every heading there
-# can be a hyperlink to itself. However, because of the current styling, such a
-# hyperlink is required (except for h1).
-
-/[ \t]*<h[23456]/ {
- id = substr($0, index($0, "id=\"") + 4)
- id = substr(id, 0, index(id, "\"") - 1)
- gsub(/$/, ORS "<a class=\"h-anchor\" href=\"#" id "\"><img src=\"/img/link-tabler.svg\" alt=\"🔗\" loading=\"lazy\"></a>")
-}
-
-{
- print
-}