diff options
| author | Track3 <34504964+Track3@users.noreply.github.com> | 2019-01-27 12:20:29 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-27 12:20:29 +0800 |
| commit | 545a122d6c17a541cc161b9660a1d590d7edf52d (patch) | |
| tree | 2c52f6a5bc0fcbdd94507aac54366a38aaa76f55 /layouts/posts/single.html | |
| parent | 503a9a3934c2515a17c88a4fc28d6d93514c6ad9 (diff) | |
| download | hermit-545a122d6c17a541cc161b9660a1d590d7edf52d.tar.gz | |
Add anchor links to heading (#38)
* Closes #36
Diffstat (limited to 'layouts/posts/single.html')
| -rw-r--r-- | layouts/posts/single.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html index e4fc4e4..9557916 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -23,7 +23,7 @@ <h1>{{ .Title }}</h1> </header> <div class="content"> - {{ .Content }} + {{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg></a>${3}` | safeHTML }} </div> <hr class="post-end"> <footer class="post-info"> |
