Compare commits

...

10 Commits

Author SHA1 Message Date
Jimmy Cai
fddab05362 release: 3.26.0 2024-05-02 23:28:01 +02:00
Jimmy Cai
f3783856ad
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
2024-05-02 23:27:17 +02:00
Jimmy Cai
130e2f6607
feat: display header anchor on hover (#999) 2024-03-30 23:22:18 +01:00
Jimmy Cai
ce798a32a9 release: 3.25.0 2024-03-27 17:01:23 +01:00
Jimmy Cai
609d43b088
fix: make KaTeX render all math inside document.body (#994)
Since it only accepts one element, I cannot pass `.article-content` and `#TableOfContent` to it. The official documentation uses `document.body` directly, so I guess that's fine.

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/882
2024-03-27 16:38:30 +01:00
Jimmy Cai
797949b37f
fix: rename .social-menu to .menu-social to avoid being blocked by ad blockers (#993)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/924
2024-03-27 16:24:03 +01:00
Jimmy Cai
539c39d69a
feat: add anchor link to markdown heading (#992)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/935
2024-03-27 16:08:19 +01:00
Jimmy Cai
f8466d94d2
fix(i18n): wrap footer.builtWith with double quotes in Japanese translation (#991) 2024-03-27 16:01:43 +01:00
Shun Sakai
43e074364c
feat(i18n): update translations for ja (#984)
* feat(i18n): update translations for `ja`

* Apply review suggestions
2024-03-27 11:21:32 +01:00
andrewmoise
b2157bdf78
docs: update some invalid documentation links (#983)
Update some documentation links (some were dead links)
2024-03-27 11:09:17 +01:00
10 changed files with 47 additions and 8 deletions

View File

@ -4,7 +4,7 @@ body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please provide as much information as possible and make sure you have checked the [documentation](https://stack.jimmycai.com/).
Thanks for taking the time to fill out this bug report! Please provide as much information as possible and make sure you have checked the [documentation](https://stack.jimmycai.com/guide/).
- type: textarea
id: what-happened
attributes:

View File

@ -222,6 +222,28 @@
margin-inline-start: calc((var(--card-padding)) * -1);
padding-inline-start: calc(var(--card-padding) - var(--heading-border-size));
border-inline-start: var(--heading-border-size) solid var(--accent-color);
position: relative;
a.header-anchor {
transition: opacity 0.3s ease;
opacity: 0;
position: absolute;
left: 0;
width: var(--card-padding);
text-align: center;
color: var(--accent-color);
&:before {
content: "#";
}
}
&:hover,
&:focus {
a.header-anchor {
opacity: 1;
}
}
}
figure {

View File

@ -212,7 +212,7 @@
}
}
.social-menu {
.menu-social {
list-style: none;
padding: 0;
margin: 0;

View File

@ -28,6 +28,7 @@ params:
src: img/avatar.png
article:
headingAnchor: false
math: false
toc: true
readingTime: true

View File

@ -203,7 +203,7 @@ params:
enabled: true
### Custom menu
### See https://docs.stack.jimmycai.com/configuration/custom-menu.html
### See https://stack.jimmycai.com/config/menu
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
menu:
main: []

View File

@ -4,6 +4,16 @@ toggleMenu:
darkMode:
other: ダークモード
list:
page:
other: "{{ .Count }} ページ目"
section:
other: セクション
subsection:
other: サブセクション
article:
back:
other: 前のページ
@ -54,7 +64,7 @@ search:
footer:
builtWith:
other: Built with {{ .Generator }}
other: "{{ .Generator }} で構築されています。"
designedBy:
other: テーマ {{ .Theme }} は {{ .DesignedBy }} によって設計されています。

View File

@ -0,0 +1,6 @@
<h{{ .Level }} id="{{ .Anchor }}">
{{- if site.Params.Article.HeadingAnchor -}}
<a href="#{{ .Anchor }}" class="header-anchor"></a>
{{- end -}}
{{ .Text | safeHTML }}
</h{{ .Level }}>

View File

@ -1,7 +1,7 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
<script>
window.addEventListener("DOMContentLoaded", () => {
renderMathInElement(document.querySelector(`.article-content`), {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },

View File

@ -1,4 +1,4 @@
{{- $ThemeVersion := "3.24.2" -}}
{{- $ThemeVersion := "3.26.0" -}}
<footer class="site-footer">
<section class="copyright">
&copy;

View File

@ -38,7 +38,7 @@
</header>
{{- with .Site.Menus.social -}}
<ol class="social-menu">
<ol class="menu-social">
{{ range . }}
<li>
<a
@ -65,7 +65,7 @@
<a href='{{ .URL }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}>
{{ $icon := default .Pre .Params.Icon }}
{{ if .Pre }}
{{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://docs.stack.jimmycai.com/configuration/custom-menu.html" .URL }}
{{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://stack.jimmycai.com/config/menu" .URL }}
{{ end }}
{{ with $icon }}
{{ partial "helper/icon" . }}