Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictoria Drake <hello@victoria.dev>2020-08-02 02:11:56 +0300
committerVictoria Drake <hello@victoria.dev>2020-08-02 02:11:56 +0300
commit8a9baff96895f71adf091abd80d398c1f03f5b8a (patch)
treea4c65d6d30e73b44742e99e4d8605923e21ee30b /layouts
parent89b8d152a9f6c83eef086747bcb29f86da92b9d0 (diff)
Linkify headings, use scroll-behavior
- Uses the scroll-behavior property to achieve smooth scrolling with less JS - Solves anchor link bugs - Linkifies headings in posts so they can be easily hyperlinked to directly
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/_markup/render-heading.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html
new file mode 100644
index 0000000..1be5073
--- /dev/null
+++ b/layouts/_default/_markup/render-heading.html
@@ -0,0 +1,2 @@
+
+<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="anchor-link"><a href="#{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}</a></h{{ .Level }}>