From 20b7963ee16b0823d894628432c4e84e6bce336c Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Tue, 20 Aug 2024 22:12:30 -0500 Subject: [PATCH 1/2] add anchor links on section headings --- content/changelog.md | 5 ++++- layouts/_default/_markup/render-heading.html | 4 ++++ static/css/custom.css | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 layouts/_default/_markup/render-heading.html diff --git a/content/changelog.md b/content/changelog.md index 9055be2..59757ae 100644 --- a/content/changelog.md +++ b/content/changelog.md @@ -1,7 +1,7 @@ --- title: "/changelog" date: "2024-05-26T21:19:08Z" -lastmod: "2024-08-15T21:21:05Z" +lastmod: "2024-08-21T03:11:27Z" description: "Maybe I should keep a log of all my site-related tinkering?" featured: false toc: false @@ -10,6 +10,9 @@ categories: slashes --- *Running list of config/layout changes to the site. The full changelog is of course [on GitHub](https://github.com/jbowdre/runtimeterror/commits/main/).* +**2024-08-20:** +- Added anchor links on section headings + **2024-08-15:** - Implemented light/dark theme toggle diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..b662fcd --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,4 @@ + + {{.Text | safeHTML}} + + \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 1941c41..0830d63 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -525,4 +525,18 @@ p:has(+ ul) { .kudos-text.thanks { font-style: italic; +} + +/* Header anchor links */ +.hlink { + display: none; +} + +h1:hover .hlink, +h2:hover .hlink, +h3:hover .hlink, +h4:hover .hlink, +h5:hover .hlink, +h6:hover .hlink { + display: inline-block; } \ No newline at end of file From 8543c9d670ea43dd78d1c77c9524d3508234b572 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Wed, 21 Aug 2024 08:33:26 -0500 Subject: [PATCH 2/2] adjust opacity/color of anchor links --- static/css/custom.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/css/custom.css b/static/css/custom.css index 0830d63..f4b381b 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -529,7 +529,8 @@ p:has(+ ul) { /* Header anchor links */ .hlink { - display: none; + opacity: 0.4; + color: var(--muted) !important; } h1:hover .hlink, @@ -538,5 +539,6 @@ h3:hover .hlink, h4:hover .hlink, h5:hover .hlink, h6:hover .hlink { - display: inline-block; + opacity: 0.8; + color: var(--link) !important; } \ No newline at end of file