summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Wiesler <jakewiesler@gmail.com>2020-06-04 15:13:42 -0400
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-11-10 12:08:52 +0530
commit2b0619f684f3b4fabdcd6457d4302f8011a059ee (patch)
tree3edcf99dd1feaffc22f16299eceb393f7b438d97
parent8574c385cdb16cd9950343df89710c89496dc988 (diff)
anchored-headings: init partial
Signed-off-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
-rw-r--r--layouts/partials/anchored_headings.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/layouts/partials/anchored_headings.html b/layouts/partials/anchored_headings.html
new file mode 100644
index 0000000..62a5084
--- /dev/null
+++ b/layouts/partials/anchored_headings.html
@@ -0,0 +1,2 @@
+<!-- formats .Content headings by adding an anchor -->
+{{ . | replaceRE "(<h[2-3] id=\"([^\"]+)\".+)(</h[2-9]+>)" "${1}<a class=\"anchor\" href=\"#${2}\">#</a>${3}" | safeHTML }}