Merge branch 'master' into canary

This commit is contained in:
Jimmy Cai 2024-03-10 23:48:40 +01:00
commit 64ecafb57f
18 changed files with 347 additions and 59 deletions

View file

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

View file

@ -66,7 +66,7 @@
} }
.social-menu, .social-menu,
.menu { #main-menu {
margin-top: var(--sidebar-element-separation); margin-top: var(--sidebar-element-separation);
} }
} }

View file

@ -59,6 +59,12 @@ comments:
issueTerm: pathname issueTerm: pathname
label: label:
beaudar:
repo:
issueTerm: pathname
label:
theme:
remark42: remark42:
host: host:
site: site:
@ -72,7 +78,7 @@ comments:
clientSecret: clientSecret:
autoCreateIssue: false autoCreateIssue: false
# Waline client configuration see: https://waline.js.org/en/reference/component.html # Waline client configuration see: https://waline.js.org/en/reference/client.html
waline: waline:
serverURL: serverURL:
lang: lang:

View file

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

View file

@ -1,6 +1,6 @@
baseurl: https://stack.jimmycai.com/demo/ baseurl: https://stack.jimmycai.com/demo/
languageCode: en-us languageCode: en-us
paginate: 5 paginate: 3
# Note: This title is overridden by the title in i18n config file # Note: This title is overridden by the title in i18n config file
title: Hugo Theme Stack Starter title: Hugo Theme Stack Starter
@ -13,9 +13,11 @@ DefaultContentLanguage: en
# This will make .Summary and .WordCount behave correctly for CJK languages. # This will make .Summary and .WordCount behave correctly for CJK languages.
hasCJKLanguage: false hasCJKLanguage: false
disqusShortname: hugo-theme-stack services:
disqus:
shortname: hugo-theme-stack
# GA Tracking ID
googleAnalytics:
id:
# GA Tracking ID publishDir: ../public/demo
googleAnalytics: ""
publishDir: ../public/demo

View file

@ -15,7 +15,7 @@ menu:
icon: user 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: 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. 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). 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 }} {{ end }}
``` ```
- To enable KaTex globally set the parameter `math` to `true` in a project's configuration - 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 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) **Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html)
{{< math.inline >}} {{< math.inline >}}
{{ if or .Page.Params.math .Site.Params.math }} {{ if or .Page.Params.math .Site.Params.math }}
<!-- KaTeX --> <!-- 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"> <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.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.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" 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> <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 }} {{ end }}
{{</ math.inline >}} {{</ math.inline >}}

72
i18n/be.yaml Normal file
View file

@ -0,0 +1,72 @@
toggleMenu:
other: Паказаць/схаваць меню
darkMode:
other: Цёмны рэжым
list:
page:
one: "{{ .Count }} старонка"
few: "{{ .Count }} старонкі"
many: "{{ .Count }} старонак"
other: "{{ .Count }} старонкі"
section:
other: Раздзел
subsection:
one: Падраздзел
few: Падраздзелы
many: Падраздзелы
other: Падраздзелы
article:
back:
other: Назад
relatedContent:
other: Таксама рэкамендуем
lastUpdatedOn:
other: Абноўлена
tableOfContents:
other: Змест
readingTime:
other: "Час чытання: {{ .Count }} хв."
notFound:
title:
other: Не знойдзена
subtitle:
other: Запытваемая старонка не існуе
widget:
archives:
title:
other: Архівы
more:
other: Яшчэ
tagCloud:
title:
other: Тэгі
search:
title:
other: Пошук
placeholder:
other: Увядзіце нешта...
resultTitle:
other: "Знайдзена #PAGES_COUNT старонак (за #TIME_SECONDS с.)"
footer:
builtWith:
other: Створана пры дапамозе {{ .Generator }}
designedBy:
other: Тэма {{ .Theme }}, дызайн {{ .DesignedBy }}

73
i18n/hi.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 }} मिनट पढ़ें"
other: "{{ .Count }} मिनट पढ़ें"
notFound:
title:
other: 404 नहीं मिला।
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 }}

71
i18n/sk.yaml Normal file
View file

@ -0,0 +1,71 @@
toggleMenu:
other: Skryť menu
darkMode:
other: Tmavý režim
list:
page:
one: "{{ .Count }} stránka"
other: "{{ .Count }} stránok"
section:
other: Kategórie
subsection:
one: Podkategória
other: Podkategórie
article:
back:
other: Späť
tableOfContents:
other: Obsah
relatedContent:
other: Súvisiace
lastUpdatedOn:
other: Naposledy aktualizované
readingTime:
one: "{{ .Count }} minúta"
other: "{{ .Count }} minút"
notFound:
title:
other: Nenájdené
subtitle:
other: Tato stránka neexistuje
widget:
archives:
title:
other: Archívy
more:
other: Viac
tagCloud:
title:
other: Štítky
categoriesCloud:
title:
other: Kategórie
search:
title:
other: Hladať
placeholder:
other: Zadajte niečo...
resultTitle:
other: "#PAGES_COUNT stránok (#TIME_SECONDS sekúnd)"
footer:
builtWith:
other: Vytvorené pomocou {{ .Generator }}
designedBy:
other: Šablóna {{ .Theme }} od {{ .DesignedBy }}

View file

@ -2,6 +2,11 @@ toggleMenu: 切换菜单
darkMode: 暗色模式 darkMode: 暗色模式
list:
page: "{{ .Count }} 个页面"
section: 章节
subsection: 子章节
article: article:
back: 返回 back: 返回
tableOfContents: 目录 tableOfContents: 目录
@ -24,5 +29,5 @@ search:
resultTitle: "#PAGES_COUNT 个结果 (用时 #TIME_SECONDS 秒)" resultTitle: "#PAGES_COUNT 个结果 (用时 #TIME_SECONDS 秒)"
footer: footer:
builtWith: Built with {{ .Generator }} builtWith: 使用 {{ .Generator }} 构建
designedBy: 主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计 designedBy: 主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计

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

@ -13,7 +13,9 @@
} }
.twikoo .el-input-group__prepend, .twikoo .el-input-group__prepend,
.twikoo .tk-action-icon, .twikoo .tk-action-icon,
.twikoo .tk-submit-action-icon,
.twikoo .tk-time, .twikoo .tk-time,
.twikoo .tk-comments-no,
.twikoo .tk-comments-count { .twikoo .tk-comments-count {
color: var(--twikoo-body-text-color); color: var(--twikoo-body-text-color);
} }
@ -28,6 +30,9 @@
.twikoo .el-button{ .twikoo .el-button{
color: var(--twikoo-body-text-color)!important; color: var(--twikoo-body-text-color)!important;
} }
.twikoo .el-input__count {
color: var(--twikoo-body-text-color) !important;
}
.OwO .OwO-body { .OwO .OwO-body {
background-color: var(--body-background) !important; background-color: var(--body-background) !important;
color: var(--body-text-color) !important; color: var(--body-text-color) !important;

View file

@ -5,7 +5,7 @@
<meta name='description' content='{{ $description }}'> <meta name='description' content='{{ $description }}'>
{{ with .Params.Keywords }}<meta name="keywords" content="{{ delimit . ", " }}">{{ end }} {{ with .Params.Keywords }}<meta name="keywords" content="{{ delimit . ", " }}">{{ end }}
{{- $title := partialCached "data/title" . .RelPermalink -}} {{- $title := partial "data/title" . -}}
<title>{{ $title }}</title> <title>{{ $title }}</title>
<link rel='canonical' href='{{ .Permalink }}'> <link rel='canonical' href='{{ .Permalink }}'>

View file

@ -32,8 +32,8 @@
<meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/> <meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
{{- end -}} {{- end -}}
{{- else -}} {{- else -}}
{{- if not .Site.LastChange.IsZero -}} {{- if not .Site.Lastmod.IsZero -}}
<meta property='og:updated_time' content='{{ .Site.LastChange.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/> <meta property='og:updated_time' content='{{ .Site.Lastmod.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

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

View file

@ -4,7 +4,10 @@
<aside class="sidebar right-sidebar sticky"> <aside class="sidebar right-sidebar sticky">
{{ range $widget := . }} {{ range $widget := . }}
{{ if templates.Exists (printf "partials/widget/%s.html" .type) }} {{ if templates.Exists (printf "partials/widget/%s.html" .type) }}
{{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" .params) }} <!-- Ensure that the `params` is not nil -->
{{- $params := default dict .params -}}
{{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" $params) }}
{{ else }} {{ else }}
{{ warnf "Widget %s not found" .type }} {{ warnf "Widget %s not found" .type }}
{{ end }} {{ end }}

View file

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