Skip to content

Commit fa2db99

Browse files
Amey-Thakurmsatmod
andcommitted
Amey's Arc
Co-authored-by: Mega Satish <mega.modha@gmail.com>
1 parent 235563b commit fa2db99

1 file changed

Lines changed: 29 additions & 3 deletions

File tree

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1-
{{- /* formats .Content headings by adding an anchor */ -}}
2-
{{ . | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" "${1}<a hidden class=\"anchor\" aria-hidden=\"true\" href=\"#${2}\">#</a>${3}" | safeHTML }}
3-
1+
<!-- ==============================================================================
2+
- File: Anchored_Headings.html (Deep-Linking Infrastructure)
3+
- Author: Amey Thakur
4+
- Profile: https://github.com/Amey-Thakur
5+
- Repository: https://github.com/Amey-Thakur/Amey-Thakur.github.io
6+
- Release Date: December 16, 2025
7+
- License: MIT License
8+
- ==============================================================================
9+
-
10+
- DESCRIPTION:
11+
- This partial post-processes the document content to inject deep-linking
12+
- anchor points within HTML headings. It facilitates precise scholarly
13+
- citation and fragment-based navigation.
14+
-
15+
- HOW IT WORKS:
16+
- It utilizes a regular expression replacement strategy to identify headings
17+
- (H1-H6) that already possess unique IDs. It then appends a hidden anchor
18+
- link (#) within the heading tags, pointing back to the fragment identifier.
19+
-
20+
- TECH STACK:
21+
- - Hugo Template Regex (replaceRE)
22+
- - HTML5 Fragment Identifiers
23+
- - CSS-driven Anchor Styling
24+
-
25+
- ============================================================================== -->
26+
27+
{{- /* Orchestration Strategy: Injecting fragment markers for enhanced scholarly citation. */ -}}
28+
{{ . | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" "${1}<a hidden class=\"anchor\" aria-hidden=\"true\"
29+
href=\"#${2}\">#</a>${3}" | safeHTML }}

0 commit comments

Comments
 (0)