From 14a63e721dc4e027ae1f98c855f35453c7b474f5 Mon Sep 17 00:00:00 2001 From: eltrac Date: Wed, 25 Mar 2026 13:33:22 +0800 Subject: feat: better inline footnotes - smaller line height - smaller font - smaller opacity unless hovered - highlight ref link when targeted --- assets/css/_markdown.scss | 10 ++++++++++ layouts/_partials/utils/inject-footnotes.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/css/_markdown.scss b/assets/css/_markdown.scss index 6252c210..09089996 100644 --- a/assets/css/_markdown.scss +++ b/assets/css/_markdown.scss @@ -203,6 +203,16 @@ } } } + + /* footnotes */ + + .inline-footnote { + p { margin: 0 } + } + + sup[id*="fnref"]:target { + background-color: rgba(255, 235, 0, .25); + } } /* gallery shortcode */ diff --git a/layouts/_partials/utils/inject-footnotes.html b/layouts/_partials/utils/inject-footnotes.html index d95d668b..31fdae82 100644 --- a/layouts/_partials/utils/inject-footnotes.html +++ b/layouts/_partials/utils/inject-footnotes.html @@ -32,7 +32,7 @@ {{ $noteContent := index $footnoteMap $refId }} {{ if $noteContent }} - {{ $inlineFootnote := printf `
%s.
%s
` $refId $refId $noteContent }} + {{ $inlineFootnote := printf `
%s.
%s
` $refId $refId $noteContent }} {{ $blockTags := slice "p" "li" "td" "th" "blockquote" "h1" "h2" "h3" "h4" "h5" "h6" "figcaption" "dt" "dd" }} -- cgit v1.2.3