From 8e3eeb501984d60d6877c20859588a961de6f141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Biron?= Date: Thu, 4 Jul 2024 12:03:41 +0200 Subject: [PATCH] Add titles anchor links --- .../assets/css/elements/titles.css | 15 +++++++++++++++ .../layouts/_default/_markup/render-heading.html | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 themes/opentermsarchive/layouts/_default/_markup/render-heading.html diff --git a/themes/opentermsarchive/assets/css/elements/titles.css b/themes/opentermsarchive/assets/css/elements/titles.css index c58900e0..031f60c1 100644 --- a/themes/opentermsarchive/assets/css/elements/titles.css +++ b/themes/opentermsarchive/assets/css/elements/titles.css @@ -119,3 +119,18 @@ h6, color: var(--colorBlack800); line-height: 1.25; } + +.title-anchor { + color: var(--colorBlack400); + font-size: 0.8em; + font-weight: normal; + display: none; +} + +h2, h3, h4, h5, h6 { + &:hover { + a.title-anchor { + display: inline; + } + } +} diff --git a/themes/opentermsarchive/layouts/_default/_markup/render-heading.html b/themes/opentermsarchive/layouts/_default/_markup/render-heading.html new file mode 100644 index 00000000..106e65a5 --- /dev/null +++ b/themes/opentermsarchive/layouts/_default/_markup/render-heading.html @@ -0,0 +1,6 @@ + + {{ .Text | safeHTML }} + {{ if ne .Level 1 }} + 🔗 + {{ end }} +