Merge branch 'master' into patch-1

This commit is contained in:
Jimmy Cai 2024-03-02 23:36:34 +01:00 committed by GitHub
commit 2f0af14b5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 236 additions and 28 deletions

View File

@ -51,6 +51,12 @@ params:
issueTerm: pathname issueTerm: pathname
label: label:
beaudar:
repo:
issueTerm: pathname
label:
theme:
remark42: remark42:
host: host:
site: site:

View File

@ -1,10 +1,18 @@
baseurl: https://example.com baseurl: https://example.com
languageCode: en-us languageCode: en-us
theme: hugo-theme-stack theme: hugo-theme-stack
paginate: 5 paginate: 3
title: Example Site title: Example Site
copyright: Example Person copyright: Example Person
# Theme i18n support
# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw
DefaultContentLanguage: en
# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
# This will make .Summary and .WordCount behave correctly for CJK languages.
hasCJKLanguage: false
languages: languages:
en: en:
languageName: English languageName: English
@ -26,19 +34,13 @@ languages:
params: params:
description: وصف تجريبي description: وصف تجريبي
# Change it to your Disqus shortname before using services:
disqusShortname: hugo-theme-stack # Change it to your Disqus shortname before using
disqus:
# GA Tracking ID shortname: "hugo-theme-stack"
googleAnalytics: # GA Tracking ID
googleAnalytics:
# Theme i18n support id:
# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw
DefaultContentLanguage: en
# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
# This will make .Summary and .WordCount behave correctly for CJK languages.
hasCJKLanguage: false
permalinks: permalinks:
post: /p/:slug/ post: /p/:slug/
@ -49,7 +51,7 @@ params:
- post - post
featuredImageField: image featuredImageField: image
rssFullContent: true rssFullContent: true
favicon: # e.g.: favicon placed in `static/favicon.ico` of your site folder, then set this field to `/favicon.ico` (`/` is necessary) favicon: # e.g.: favicon placed in `static/favicon.ico` of your site folder, then set this field to `/favicon.ico` (`/` is necessary)
footer: footer:
since: 2020 since: 2020
@ -91,6 +93,12 @@ params:
issueTerm: pathname issueTerm: pathname
label: label:
beaudar:
repo:
issueTerm: pathname
label:
theme:
remark42: remark42:
host: host:
site: site:

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 }}

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

@ -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

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

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

@ -77,15 +77,17 @@
<div class="menu-bottom-section"> <div class="menu-bottom-section">
{{- $currentLanguageCode := .Language.Lang -}} {{- $currentLanguageCode := .Language.Lang -}}
{{ with .Site.Home.AllTranslations }} {{ if ( compare.Gt .Site.Home.AllTranslations.Len 1 ) }}
<li id="i18n-switch"> {{ with .Site.Home.AllTranslations }}
{{ partial "helper/icon" "language" }} <li id="i18n-switch">
<select name="language" onchange="window.location.href = this.selectedOptions[0].value"> {{ partial "helper/icon" "language" }}
{{ range . }} <select name="language" onchange="window.location.href = this.selectedOptions[0].value">
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option> {{ range . }}
{{ end }} <option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
</select> {{ end }}
</li> </select>
</li>
{{ end }}
{{ end }} {{ end }}
{{ if (default false .Site.Params.colorScheme.toggle) }} {{ if (default false .Site.Params.colorScheme.toggle) }}

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 }}