From f3783856ad9ce3a5e3c4358b97092f9cc229851d Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Thu, 2 May 2024 23:27:17 +0200 Subject: [PATCH 1/2] feat: add `article.headingAnchor` parameter and use CSS pseudo-element to display `#` symbol of heading anchor (#1016) * feat: add `article.headingAnchor` parameter * feat: use CSS pseudo-element to display `#` symbol of heading anchor This prevents RSS feed readers and screen readers from seeing an extra `#`. * Deactivate `article.headingAnchor` by default --- assets/scss/partials/layout/article.scss | 4 ++++ config.yaml | 1 + layouts/_default/_markup/render-heading.html | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index 54c69eb..2a61423 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -232,6 +232,10 @@ width: var(--card-padding); text-align: center; color: var(--accent-color); + + &:before { + content: "#"; + } } &:hover, diff --git a/config.yaml b/config.yaml index ece0ecb..b1a0bff 100644 --- a/config.yaml +++ b/config.yaml @@ -28,6 +28,7 @@ params: src: img/avatar.png article: + headingAnchor: false math: false toc: true readingTime: true diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index af79692..f79308a 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,4 +1,6 @@ - # + {{- if site.Params.Article.HeadingAnchor -}} + + {{- end -}} {{ .Text | safeHTML }} \ No newline at end of file From fddab053628070668cd9c9eb0b96d9a6246fcc71 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Thu, 2 May 2024 23:28:01 +0200 Subject: [PATCH 2/2] release: 3.26.0 --- layouts/partials/footer/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index 59ef37b..5193afa 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,4 +1,4 @@ -{{- $ThemeVersion := "3.25.0" -}} +{{- $ThemeVersion := "3.26.0" -}}