Compare commits

..

53 Commits

Author SHA1 Message Date
Jimmy Cai
9e6b7b22a9 release: 3.30.0 2025-01-23 22:55:27 +01:00
Jimmy
f1ab6c6aba
fix(giscus): no longer use $.Language.LanguageCode for the language of Giscus (#1118)
fix(giscus): rollback https://github.com/CaiJimmy/hugo-theme-stack/pull/1075

User can still customize the language used for Giscus using `.Site.Params.comments.giscus.lang` parameter.
2025-01-23 22:54:37 +01:00
Hamza
087989e427
chore(i18n): fix a tiny typo in the footer (#1099) 2024-12-22 14:53:10 +01:00
fsj2009yx
0991f61d49
fix(comment/waline): cannot read property ‘insertBefore’ of null (#1103)
* fix: resolve issue with comments not displaying due to KaTeX and Waline render order

* Fix the problem that comment data couldn't be pulled successfully and raise Error "Cannot read property ‘insertBefore’ of null""
2024-12-22 12:44:13 +01:00
Jimmy Cai
839fbd0ecb release: 3.29.0 2024-10-20 08:05:45 +00:00
Jimmy Cai
5175ac5ae3
fix(giscus): fallback to en if no language code is set (#1084) 2024-10-20 10:04:59 +02:00
Jimmy Cai
37f1541c20
feat: search box in 404 page (#1081) 2024-10-20 00:26:59 +02:00
Jimmy Cai
f4eb5d3e99 release: 3.28.0 2024-10-19 21:32:49 +00:00
xiaoxiyao
788dd497b3
feat: add fingerprints to the JS file URL to utilize HTTP caching (#1076) 2024-10-19 21:14:35 +02:00
xiaoxiyao
8a7fb33163
feat(giscus): use current language as fallback for lang param and add loading param (#1075)
fix: giscus use current lang as default, and add missing `loading` params
2024-10-19 20:46:27 +02:00
onavas33
2a18a92901
fix(i18n): missing translation for title of categories widget in fr.yaml (#1059) 2024-10-06 19:33:20 +02:00
PukNgae Cryolitia
245b0f2810
fix(colorScheme): systemPreferScheme not initialized on start up (#1061) 2024-10-06 19:32:13 +02:00
Jimmy Cai
0fb25c808b
fix: show different subtitle for each i18n variant in exampleSite (#1068) 2024-10-06 19:17:40 +02:00
Jimmy Cai
048a000f17 release: 3.27.0 2024-09-07 18:57:23 +02:00
Jimmy Cai
5f157478aa
fix(exampleSite): site config key paginate was deprecated (#1057)
fix: site config key paginate was deprecated
2024-09-07 18:51:18 +02:00
Jimmy Cai
8556681b7c
doc: add markup.goldmark.extensions.passthrough in exampleSite (#1056)
Related: https://github.com/CaiJimmy/hugo-theme-stack/issues/1019
2024-09-07 18:47:15 +02:00
powerfullz
fa760d70cb
fix: use css.Sass instead of deprecated resources.ToCSS (#1054) 2024-09-07 18:42:07 +02:00
Syafa Adena
bdcab89d86
chore: bump Twikoo front-end to latest released version 1.6.39 (#1021) 2024-09-07 18:14:57 +02:00
saikadaramakaisosjupita
b3907acdae
doc: add backslash to baseURL in exampleSite (#1009) 2024-09-07 17:59:59 +02:00
Vladimir Vitkov
23ff70d41a
feat(i18n): add Bulgarian translations (#1007) 2024-09-07 17:56:17 +02:00
ensag-dev
41a3e5ee13
feat(i18n): add Occitan translations (#1034) 2024-09-07 17:52:40 +02:00
DashJay
0558108e30
feat(comments): add support to Gitalk proxy parameter (#1012)
Co-authored-by: Jimmy Cai <hi@jimmycai.com>
2024-09-07 17:18:03 +02:00
Anthony Simmon
12f31dfd8a
fix: use Hugo's default RSS template value source for lastBuildDate (#1006)
Use Hugo's default RSS template value source for lastBuildDate
2024-09-07 14:22:17 +02:00
weeix
374b25a60f
fix(i18n): fix unlocalized article publish/lastUpdated date (#1050)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/1040
2024-09-07 13:48:09 +02:00
Jimmy Cai
fcd56dd21c
fix: article category overflow (#1055)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/1045
2024-09-07 13:25:26 +02:00
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
Jimmy Cai
23607527e4
fix: use page resource permalink in link image (#990)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/982
2024-03-27 10:58:22 +01:00
Jimmy Cai
54a8ace564 release 3.24.2 2024-03-17 20:41:27 +01:00
Andreas Deininger
b3fbe78ca5
fix: deprecation warning for .Site.Author (#979)
Fix deprecation warning for .Site.Author, deprecated in Hugo 0.124.0
2024-03-17 20:40:56 +01:00
Jimmy Cai
2cb5ba683b
fix: remove \n character from meta description (#980) 2024-03-17 20:39:16 +01:00
Jimmy Cai
5a8607e4a8 release: 3.24.1 2024-03-12 14:52:03 +01:00
Andrew Doering
eafcf894c8
fix: favicon does not load if baseurl includes a subfolder (#972)
Use relURL https://gohugo.io/functions/urls/relurl/
2024-03-12 14:50:49 +01:00
Jimmy Cai
0b9f6c36ad
fix(head): prevent Go template from escaping HTML entities in meta description (#973) 2024-03-12 14:45:59 +01:00
Jimmy Cai
04bf1956b9 release: 3.24.0 2024-03-10 22:57:26 +01:00
Jiahao Li
6c7d42d45a
fix(sidebar): menu-bottom-section not showing in mobile (#966)
* fix(sidebar): Bottom section not showing in mobile

* fix(sidebar): Align bottom section to bottom

* fix(sidebar): Gap missing in bottom section

* refactor(sidebar): Simplify styles

* refactor(sidebar): Remove useless padding-left

* refactor(sidebar): Remove useless margin-top

* refactor(sidebar): Combine duplicate flex-direction

* refactor(sidebar): Remove redundant width
2024-03-10 22:56:30 +01:00
Andreas Deininger
2cda779706
feat: bump KaTeX to latest released version 0.16.9 (#969)
Bump KaTeX to latest released version 0.16.9
2024-03-10 22:24:21 +01:00
Andreas Deininger
4948a3723e
fix: .Site.LastChange deprecation (#968)
Fix the deprecation warning emitted from Hugo, and fix the typo in ` exampleSite/content/page/about/index.md`
2024-03-10 19:57:03 +01:00
Jimmy Cai
43224bd39a
feat: update Hugo version and minimum version requirement to 0.123.0 (#970) 2024-03-10 19:54:09 +01:00
Zeyu Huang
4e7865c185
fix(i18n): add missing zh-cn translations (#964) 2024-03-06 09:37:31 +01:00
Jimmy Cai
2f9306502d release: 3.23.0 2024-03-02 23:49:21 +01:00
Jiahao Li
5b0d6fdf7d
fix(sidebar): improve accessibility of sidebar bottom menu (#925)
* fix(menu): <ol> containing other than <li>, <script> or <template> elements

* fix(menu): add title to language select menu
2024-03-02 23:48:34 +01:00
L-Super
65cd7f586f
fix(comment): moved waline placeholder parameter to locale.placeholder (#914)
fix waline parameter
2024-03-02 23:39:43 +01:00
Jiarong Hong
f398fb9dd1
feat(comments): add support for Beaudar(表达)comment system (#931)
https://beaudar.lipk.org/
2024-03-02 23:33:11 +01:00
James McMurry
9bb3165ff0
fix(sidebar): translation selector - avoid cast per PR #950 (#961)
avoid cast per PR #950
2024-03-02 23:16:27 +01:00
39 changed files with 418 additions and 89 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

@ -131,6 +131,7 @@
.article-tags {
display: flex;
gap: 10px;
flex-wrap: wrap;
a {
color: var(--accent-color-text);

View File

@ -67,7 +67,6 @@
}
.article-tags {
flex-wrap: wrap;
text-transform: unset;
}
@ -222,6 +221,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

@ -127,10 +127,8 @@
}
/* Menu style */
.menu {
padding-left: 0;
#main-menu {
list-style: none;
flex-direction: column;
overflow-y: auto;
flex-grow: 1;
font-size: 1.4rem;
@ -141,13 +139,15 @@
margin: 0 calc(var(--container-padding) * -1);
padding: 30px 30px;
@include respond(xl) {
padding: 15px 0;
}
&,
.menu-bottom-section {
&, .menu-bottom-section ol {
flex-direction: column;
gap: 30px;
@include respond(xl) {
gap: 25px;
}
@ -200,17 +200,19 @@
font-weight: bold;
}
}
}
.menu-bottom-section {
margin-top: auto;
display: flex;
flex-direction: column;
width: 100%;
&.menu-bottom-section {
margin-top: auto;
ol {
display: flex;
padding-left: 0;
}
}
}
}
.social-menu {
.menu-social {
list-style: none;
padding: 0;
margin: 0;

View File

@ -8,6 +8,10 @@ class StackColorScheme {
constructor(toggleEl: HTMLElement) {
this.bindMatchMedia();
this.currentScheme = this.getSavedScheme();
if (window.matchMedia('(prefers-color-scheme: dark)').matches === true)
this.systemPreferScheme = 'dark'
else
this.systemPreferScheme = 'light';
this.dispatchEvent(document.documentElement.dataset.scheme as colorScheme);

View File

@ -53,7 +53,14 @@ class Search {
this.resultTitle = resultTitle;
this.resultTitleTemplate = resultTitleTemplate;
this.handleQueryString();
/// Check if there's already value in the search input
if (this.input.value.trim() !== '') {
this.doSearch(this.input.value.split(' '));
}
else {
this.handleQueryString();
}
this.bindQueryStringChange();
this.bindSearchForm();
}

View File

@ -28,6 +28,7 @@ params:
src: img/avatar.png
article:
headingAnchor: false
math: false
toc: true
readingTime: true
@ -51,6 +52,12 @@ params:
issueTerm: pathname
label:
beaudar:
repo:
issueTerm: pathname
label:
theme:
remark42:
host:
site:
@ -64,7 +71,7 @@ params:
clientSecret:
autoCreateIssue: false
# Waline client configuration see: https://waline.js.org/en/reference/client.html
# Waline client configuration see: https://waline.js.org/en/reference/client/props.html
waline:
serverURL:
lang:
@ -75,9 +82,9 @@ params:
requiredMeta:
- nick
- mail
placeholder:
locale:
admin: Admin
placeholder:
twikoo:
envId:

View File

@ -21,17 +21,17 @@ PhotoSwipe:
type: style
KaTeX:
- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.css
integrity: sha256-J+iAE0sgH8QSz9hpcDxXIftnj65JEZgNhGcgReTTK9s=
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css
integrity: sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV
type: style
- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.js
integrity: sha256-InsNdER1b2xUewP+pKCUJpkhiqwHgqiPXDlIk7GzBu4=
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js
integrity: sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8
type: script
defer: true
- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/contrib/auto-render.min.js
integrity: sha256-y39Mpg7V3D4lhBX4x6O0bUqTV4pSrfgwEfGKfxkOdgI=
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js
integrity: sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05
type: script
defer: true

View File

@ -15,7 +15,7 @@ menu:
icon: user
---
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
Written in Go, Hugo is an open source static site generator available under the [Apache License 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
Hugo makes use of a variety of open source projects including:
@ -29,6 +29,6 @@ Hugo is ideal for blogs, corporate websites, creative portfolios, online magazin
Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.
Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.
Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.
Learn more and contribute on [GitHub](https://github.com/gohugoio).

View File

@ -21,17 +21,17 @@ In this example we will be using [KaTeX](https://katex.org/)
{{ end }}
```
- To enable KaTex globally set the parameter `math` to `true` in a project's configuration
- To enable KaTex on a per page basis include the parameter `math: true` in content files
- To enable KaTeX globally set the parameter `math` to `true` in a project's configuration
- To enable KaTeX on a per page basis include the parameter `math: true` in content files
**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html)
{{< math.inline >}}
{{ if or .Page.Params.math .Site.Params.math }}
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
{{ end }}
{{</ math.inline >}}

View File

@ -1,7 +1,6 @@
baseurl: https://example.com
baseurl: https://example.com/
languageCode: en-us
theme: hugo-theme-stack
paginate: 3
title: Example Site
copyright: Example Person
@ -19,20 +18,23 @@ languages:
title: Example Site
weight: 1
params:
description: Example description
sidebar:
subtitle: Example description
zh-cn:
languageName: 中文
title: 演示站点
weight: 2
params:
description: 演示说明
sidebar:
subtitle: 演示说明
ar:
languageName: عربي
languagedirection: rtl
title: موقع تجريبي
weight: 3
params:
description: وصف تجريبي
sidebar:
subtitle: وصف تجريبي
services:
# Change it to your Disqus shortname before using
@ -42,6 +44,9 @@ services:
googleAnalytics:
id:
pagination:
pagerSize: 3
permalinks:
post: /p/:slug/
page: /:slug/
@ -93,6 +98,12 @@ params:
issueTerm: pathname
label:
beaudar:
repo:
issueTerm: pathname
label:
theme:
remark42:
host:
site:
@ -150,6 +161,7 @@ params:
repo:
clientID:
clientSecret:
proxy:
cusdis:
host:
@ -197,7 +209,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: []
@ -228,6 +240,18 @@ related:
markup:
goldmark:
extensions:
passthrough:
enable: true
delimiters:
block:
- - \[
- \]
- - $$
- $$
inline:
- - \(
- \)
renderer:
## Set to true if you have HTML content inside Markdown
unsafe: true

View File

@ -68,7 +68,7 @@ search:
footer:
builtWith:
other: "مبني بستخدام {{ .Generator }}"
other: "مبني باستخدام {{ .Generator }}"
designedBy:
other: "قالب {{ .Theme }} مصمم من {{ .DesignedBy }}"

73
i18n/bg.yaml Normal file
View File

@ -0,0 +1,73 @@
toggleMenu:
other: Покажи Меню
darkMode:
other: Тъмен Режим
list:
page:
one: "{{ .Count }} страница"
other: "{{ .Count }} страници"
section:
other: Секция
subsection:
one: Подсекция
other: Подсекции
article:
back:
other: Назад
tableOfContents:
other: Съдържание
relatedContent:
other: Свързано Съдържание
lastUpdatedOn:
other: Последна промяна на
readingTime:
one: "{{ .Count }} minute read"
other: "{{ .Count }} minute read"
notFound:
title:
other: Не е намерено
subtitle:
other: Страницата която търсите не е открита
widget:
archives:
title:
other: Архиви
more:
other: Повече
tagCloud:
title:
other: Тагове
categoriesCloud:
title:
other: Категории
search:
title:
other: Търсене
placeholder:
other: Напишете нещо...
resultTitle:
other: "#PAGES_COUNT страници (#TIME_SECONDS секунди)"
footer:
builtWith:
other: Създадено с {{ .Generator }}
designedBy:
other: Тема {{ .Theme }} създадена от {{ .DesignedBy }}

View File

@ -50,6 +50,9 @@ widget:
tagCloud:
title:
other: Mots clés
categoriesCloud:
title:
other: Catégories
search:
title:

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 }} によって設計されています。

72
i18n/oc.yaml Normal file
View File

@ -0,0 +1,72 @@
toggleMenu:
other: Alternar menú
darkMode:
other: Mòde fosc
list:
page:
one: "{{ .Count }} pagina"
other: "{{ .Count }} paginas"
section:
other: Seccion
subsection:
one: Josseccion
other: Josseccions
article:
back:
other: Tornar
tableOfContents:
other: Taula de contengut
relatedContent:
other: Contenguts relacionats
lastUpdatedOn:
other: Darrièra actualizacion
readingTime:
one: "{{ .Count }} minuta de lectura"
other: "{{ .Count }} minutas de lectura"
notFound:
title:
other: Non trobat
subtitle:
other: Aquesta pagina existís pas
widget:
archives:
title:
other: Archiu
more:
other: Mai
tagCloud:
title:
other: Etiquetas
categoriesCloud:
title:
other: Categorias
search:
title:
other: Cercar
placeholder:
other: Picatz quicòm...
resultTitle:
other: "#PAGES_COUNT paginas dins (#TIME_SECONDS segons)"
footer:
builtWith:
other: Creat amb {{ .Generator }}
designedBy:
other: Tàma {{ .Theme }} concebut per {{ .DesignedBy }}

View File

@ -4,6 +4,13 @@ toggleMenu:
darkMode:
other: 暗色模式
list:
page: "{{ .Count }} 个页面"
section: 章节
subsection: 子章节
article:
back:
other: 返回
@ -54,7 +61,7 @@ search:
footer:
builtWith:
other: Built with {{ .Generator }}
other: 使用 {{ .Generator }} 构建
designedBy:
other: 主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计

View File

@ -3,5 +3,43 @@
<h1 class="article-title">{{ T "notFound.title" }}</h1>
<h2 class="article-subtitle">{{ T "notFound.subtitle" }}</h2>
</div>
{{- $query := first 1 (where .Site.Pages "Layout" "==" "search") -}}
{{- $searchPage := index $query 0 -}}
{{- with $searchPage -}}
<form action="{{ $searchPage.RelPermalink }}" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
<p>
<label>{{ T "search.title" }}</label>
<input id="searchInput" name="keyword" required placeholder="{{ T `search.placeholder` }}" />
<button title="{{ T `search.title` }}">
{{ partial "helper/icon" "search" }}
</button>
</p>
</form>
<div class="search-result">
<h3 class="search-result--title section-title"></h3>
<div class="search-result--list article-list--compact"></div>
</div>
<script>
window.searchResultTitleTemplate = "{{ T `search.resultTitle` }}"
</script>
{{- $opts := dict "minify" hugo.IsProduction "JSXFactory" "createElement" -}}
{{- $searchScript := resources.Get "ts/search.tsx" | js.Build $opts -}}
<script type="text/javascript" src="{{ $searchScript.RelPermalink }}" defer></script>
<script>
const wrongUrl = new URL(window.location.href);
/// Get the search keyword from the wrong URL by removing all slashes and dashes
const searchKeyword = wrongUrl.pathname.split(/[/|-]/).join(' ').trim();
document.getElementById('searchInput').setAttribute('value', searchKeyword);
</script>
{{- end -}}
{{ partialCached "footer/footer" . }}
{{ end }}

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

@ -18,11 +18,11 @@
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<language>{{.}}</language>{{end}}{{ with .Site.Params.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.Author.email }}
<webMaster>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
<lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}}
@ -35,7 +35,7 @@
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
{{ with .Site.Params.Author.email }}<author>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>
{{- $image := partial "helper/image" (dict "Context" . "Type" "rss") -}}

View File

@ -32,7 +32,7 @@
<div>
{{ partial "helper/icon" "date" }}
<time class="article-time--published">
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
{{- .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
</time>
</div>
{{ end }}

View File

@ -12,7 +12,7 @@
<section class="article-lastmod">
{{ partial "helper/icon" "clock" }}
<span>
{{ T "article.lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
{{ T "article.lastUpdatedOn" }} {{ .Lastmod | time.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
</span>
</section>
{{- end -}}

View File

@ -16,8 +16,12 @@
</div>
{{ with $link.image }}
{{ $permalink := . }}
{{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }}
{{ $permalink = .RelPermalink }}
{{ end }}
<div class="article-image">
<img src="{{ . }}" loading="lazy">
<img src="{{ $permalink }}" loading="lazy">
</div>
{{ end }}
</a>

View File

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

View File

@ -0,0 +1,46 @@
<script
src="https://beaudar.lipk.org/client.js"
repo="{{ .Site.Params.comments.beaudar.repo }}"
issue-term="{{ .Site.Params.comments.beaudar.issueTerm }}"
{{ with .Site.Params.comments.beaudar.label }}
label="{{ . }}"
{{ end }}
theme="{{ .Site.Params.comments.beaudar.theme }}"
crossorigin="anonymous"
async
></script>
<style>
.beaudar {
max-width: unset;
}
</style>
<script>
let beaudarLoaded = false;
function setBeaudarTheme(theme) {
let beaudar = document.querySelector(".beaudar iframe");
if (beaudar) {
beaudar.contentWindow.postMessage(
{
type: "set-theme",
theme: `github-${theme}`,
},
"https://beaudar.lipk.org"
);
}
}
addEventListener("message", (event) => {
if (event.origin !== "https://beaudar.lipk.org") return;
/// Called when Beaudar is ready
beaudarLoaded = true;
setBeaudarTheme(document.documentElement.dataset.scheme);
});
window.addEventListener("onColorSchemeChange", (e) => {
if (!beaudarLoaded) return;
setBeaudarTheme(e.detail);
});
</script>

View File

@ -2,7 +2,7 @@
{{- $disqusjs := .Site.Params.Comments.disqusjs -}}
{{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}}
{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | resources.ToCSS | minify -}}
{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | toCSS | minify -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<div class="disqus-container">

View File

@ -12,6 +12,7 @@
data-input-position="{{- default `top` .inputPosition -}}"
data-theme="{{- default `light` .lightTheme -}}"
data-lang="{{- default `en` .lang -}}"
data-loading="{{- .loading -}}"
crossorigin="anonymous"
async
></script>

View File

@ -15,6 +15,7 @@
admin: ["{{- .admin -}}"],
distractionFreeMode: false, // Facebook-like distraction free mode
id: md5(location.pathname), // Max Location.pathname Legth:75 https://github.com/gitalk/gitalk/issues/102
proxy: {{- .proxy -}},
});
(function () {
if (

View File

@ -1,4 +1,4 @@
<script src="//cdn.jsdelivr.net/npm/twikoo@1.6.21/dist/twikoo.all.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/twikoo@1.6.39/dist/twikoo.all.min.js"></script>
<div id="tcomment"></div>
<style>
.twikoo {

View File

@ -14,4 +14,4 @@
{{ $description = .Summary }}
{{ end }}
{{ return ($description | plainify)}}
{{ return (replaceRE "\n" " " $description | plainify) }}

View File

@ -1,12 +1,12 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}}
{{- $opts := dict "minify" hugo.IsProduction -}}
{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}}
{{- $script := resources.Get "ts/main.ts" | js.Build $opts | fingerprint -}}
<script type="text/javascript" src="{{ $script.RelPermalink }}" defer></script>
{{- with resources.Get "ts/custom.ts" -}}
{{/* Place your custom script in HUGO_SITE_FOLDER/assets/ts/custom.ts */}}
{{- $customScript := . | js.Build $opts -}}
{{- $customScript := . | js.Build $opts | fingerprint -}}
<script type="text/javascript" src="{{ $customScript.RelPermalink }}" defer></script>
{{- end -}}

View File

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

View File

@ -2,7 +2,7 @@
<meta name='viewport' content='width=device-width, initial-scale=1'>
{{- $description := partialCached "data/description" . .RelPermalink -}}
<meta name='description' content='{{ $description }}'>
<meta name='description' {{ printf "content=%q" $description | safeHTMLAttr }}>
{{ with .Params.Keywords }}<meta name="keywords" content="{{ delimit . ", " }}">{{ end }}
{{- $title := partial "data/title" . -}}
@ -19,7 +19,7 @@
{{- end -}}
{{ with .Site.Params.favicon }}
<link rel="shortcut icon" href="{{ . }}" />
<link rel="shortcut icon" href="{{ . | relURL }}" />
{{ end }}
{{- template "_internal/google_analytics.html" . -}}

View File

@ -1,8 +1,8 @@
{{- $title := partialCached "data/title" . .RelPermalink -}}
{{- $description := partialCached "data/description" . .RelPermalink -}}
<meta property='og:title' content='{{ $title }}'>
<meta property='og:description' content='{{ $description }}'>
<meta property='og:title' {{ printf "content=%q" $title | safeHTMLAttr }}>
<meta property='og:description' {{ printf "content=%q" $description | safeHTMLAttr }}>
<meta property='og:url' content='{{ .Permalink }}'>
<meta property='og:site_name' content='{{ .Site.Title }}'>
<meta property='og:type' content='
@ -32,8 +32,8 @@
<meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
{{- end -}}
{{- else -}}
{{- if not .Site.LastChange.IsZero -}}
<meta property='og:updated_time' content='{{ .Site.LastChange.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
{{- if not .Site.Lastmod.IsZero -}}
<meta property='og:updated_time' content='{{ .Site.Lastmod.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
{{- end -}}
{{- end -}}

View File

@ -6,8 +6,8 @@
{{- $title := partialCached "data/title" . .RelPermalink -}}
{{- $description := partialCached "data/description" . .RelPermalink -}}
<meta name="twitter:title" content="{{ $title }}">
<meta name="twitter:description" content="{{ $description }}">
<meta name="twitter:title" {{ printf "content=%q" $title | safeHTMLAttr }}>
<meta name="twitter:description" {{ printf "content=%q" $description | safeHTMLAttr }}>
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}}
{{- if $image.exists -}}

View File

@ -1,3 +1,3 @@
{{ $sass := resources.Get "scss/style.scss" }}
{{ $style := $sass | resources.ToCSS | minify | resources.Fingerprint "sha256" }}
{{ $style := $sass | toCSS | minify | resources.Fingerprint "sha256" }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">

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" . }}
@ -74,29 +74,30 @@
</a>
</li>
{{ end }}
<li class="menu-bottom-section">
<ol class="menu">
{{- $currentLanguageCode := .Language.Lang -}}
{{ if ( compare.Gt .Site.Home.AllTranslations.Len 1 ) }}
{{ with .Site.Home.AllTranslations }}
<li id="i18n-switch">
{{ partial "helper/icon" "language" }}
<select name="language" title="language" onchange="window.location.href = this.selectedOptions[0].value">
{{ range . }}
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
{{ end }}
</select>
</li>
{{ end }}
{{ end }}
<div class="menu-bottom-section">
{{- $currentLanguageCode := .Language.Lang -}}
{{ if ( compare.Gt .Site.Home.AllTranslations 1 ) }}
{{ with .Site.Home.AllTranslations }}
<li id="i18n-switch">
{{ partial "helper/icon" "language" }}
<select name="language" onchange="window.location.href = this.selectedOptions[0].value">
{{ range . }}
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
{{ end }}
</select>
{{ if (default false .Site.Params.colorScheme.toggle) }}
<li id="dark-mode-toggle">
{{ partial "helper/icon" "toggle-left" }}
{{ partial "helper/icon" "toggle-right" }}
<span>{{ T "darkMode" }}</span>
</li>
{{ end }}
{{ end }}
{{ if (default false .Site.Params.colorScheme.toggle) }}
<li id="dark-mode-toggle">
{{ partial "helper/icon" "toggle-left" }}
{{ partial "helper/icon" "toggle-right" }}
<span>{{ T "darkMode" }}</span>
</li>
{{ end }}
</div>
</ol>
</li>
</ol>
</aside>

View File

@ -2,7 +2,7 @@
publish = "exampleSite/public"
[build.environment]
HUGO_VERSION = "0.117.0"
HUGO_VERSION = "0.124.0"
HUGO_THEME = "repo"
[context.production]

View File

@ -20,7 +20,7 @@ features = [
"search",
]
min_version = "0.87.0"
min_version = "0.123.0"
[author]
name = "Jimmy Cai"