diff options
author | Victoria Drake <hello@victoria.dev> | 2020-08-02 02:11:56 +0300 |
---|---|---|
committer | Victoria Drake <hello@victoria.dev> | 2020-08-02 02:11:56 +0300 |
commit | 8a9baff96895f71adf091abd80d398c1f03f5b8a (patch) | |
tree | a4c65d6d30e73b44742e99e4d8605923e21ee30b /layouts | |
parent | 89b8d152a9f6c83eef086747bcb29f86da92b9d0 (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.html | 2 |
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 }}> |