From 11b1074ede0c03cedc6c69d5b46ab335f1ba0e55 Mon Sep 17 00:00:00 2001 From: Melora Hugues Date: Tue, 2 Jul 2024 22:53:20 +0200 Subject: [PATCH] Add support for clickable headers --- layouts/_default/_markup/render-heading.html | 9 +++++++++ static/css/heading.css | 13 +++++++++++++ themes/hello-friend-ng/layouts/_default/baseof.html | 1 + 3 files changed, 23 insertions(+) create mode 100644 layouts/_default/_markup/render-heading.html create mode 100644 static/css/heading.css diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..506292f --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,9 @@ + + + + Link to this section + + + +  {{ .Text | safeHTML }} + \ No newline at end of file diff --git a/static/css/heading.css b/static/css/heading.css new file mode 100644 index 0000000..c5e37a8 --- /dev/null +++ b/static/css/heading.css @@ -0,0 +1,13 @@ +.hash-link { + /* -webkit-transform: translateX(-100%); */ + /* left: 0; + opacity: 0; + padding: 0 5px; + position: absolute; + transform: translateX(-100%); + transition: opacity .1s ease-in; + will-change: transform, opacity; */ + svg { + stroke: rgb(138, 173, 244); + } +} \ No newline at end of file diff --git a/themes/hello-friend-ng/layouts/_default/baseof.html b/themes/hello-friend-ng/layouts/_default/baseof.html index 4cf9ca4..ee90f6b 100644 --- a/themes/hello-friend-ng/layouts/_default/baseof.html +++ b/themes/hello-friend-ng/layouts/_default/baseof.html @@ -4,6 +4,7 @@ {{ partial "head.html" . }} + {{ block "body" . }}