Merge branch 'master' into fix-multilangual

This commit is contained in:
MikDal002 2021-10-15 20:12:19 +02:00 committed by GitHub
commit 794c3ab81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 125 additions and 13 deletions

View File

@ -14,6 +14,10 @@ googleAnalytics:
# Available values: en, fr, id, ja, ko, pt-br, zh-cn, es, de, nl, it
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:
post: /p/:slug/
page: /:slug/
@ -111,6 +115,17 @@ params:
reactionsEnabled: 1
emitMetadata: 0
gitalk:
owner:
admin:
repo:
clientID:
clientSecret:
cusdis:
host:
id:
widgets:
enabled:
- search
@ -176,6 +191,10 @@ related:
weight: 200
markup:
goldmark:
renderer:
## Set to true if you have HTML content inside Markdown
unsafe: false
tableOfContents:
endLevel: 4
ordered: true

View File

@ -32,3 +32,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
## Vimeo Simple Shortcode
{{< vimeo_simple 48912912 >}}
## bilibilibi Shortcode
{{< bilibili av498363026 >}}

View File

@ -17,23 +17,37 @@ list:
other: Unterabschnitte
article:
back:
other: Zurück
tableOfContents:
other: Inhaltsverzeichnis
relatedContents:
other: Verwandte Inhalte
lastUpdatedOn:
other: Zuletzt aktualisiert am
readingTime:
one: "{{ .Count }} Minute Lesezeit"
other: "{{ .Count }} Minuten Lesezeit"
notFound:
title:
other: Seite nicht gefunden
subtitle:
other: Diese Seite existiert nicht.
other: Diese Seite existiert nicht
widget:
archives:
title:
other: Archiv
more:
other: Weitere
tagCloud:
title:
other: Schlagwörter
@ -41,13 +55,16 @@ widget:
search:
title:
other: Suche
placeholder:
other: Etwas tippen...
resultTitle:
other: "#PAGES_COUNT pages (#TIME_SECONDS seconds)"
other: "#PAGES_COUNT Seiten (#TIME_SECONDS Sekunden)"
footer:
builtWith:
other: Erstellt mit {{ .Generator }}
designedBy:
other: Theme {{ .Theme }} gestaltet von {{ .DesignedBy }}

View File

@ -30,15 +30,15 @@ article:
other: Last updated on
readingTime:
one: "{{ .Count }} min read"
### Seems that there's no need to add 's' even if it's plural in English
other: "{{ .Count }} min read"
one: "{{ .Count }} minute read"
other: "{{ .Count }} minute read"
notFound:
title:
other: Not Found
subtitle:
other: This page does not exist.
other: This page does not exist
widget:
archives:

View File

@ -17,14 +17,26 @@ list:
other: Subsecciones
article:
back:
other: Volver
tableOfContents:
other: Tabla de contenido
relatedContents:
other: Contenidos relacionados
lastUpdatedOn:
other: Última vez actualizado
readingTime:
one: "{{ .Count }} minuto a leer"
other: "{{ .Count }} minutos a leer"
notFound:
title:
other: No Encontrado
subtitle:
other: Esta página no existe
@ -32,8 +44,10 @@ widget:
archives:
title:
other: Archivo
more:
other: Más
tagCloud:
title:
other: Etiquetas
@ -41,13 +55,16 @@ widget:
search:
title:
other: Búsqueda
placeholder:
other: Teclea algo...
resultTitle:
other: "#PAGES_COUNT páginas en (#TIME_SECONDS segundos)"
footer:
builtWith:
other: Creado con {{ .Generator }}
designedBy:
other: Tema {{ .Theme }} diseñado por {{ .DesignedBy }}

View File

@ -17,7 +17,7 @@
{{ partial "article/components/related-contents" . }}
{{ if or (not (isset .Params "comments")) (eq .Params.comments "true")}}
{{ if not (eq .Params.comments false) }}
{{ partial "comments/include" . }}
{{ end }}
@ -54,4 +54,4 @@
</section>
</aside>
{{ end }}
{{ end }}
{{ end }}

View File

@ -0,0 +1,24 @@
<div id="cusdis_thread"
{{ if .Site.Params.comments.cusdis.host }}
data-host="{{ .Site.Params.comments.cusdis.host }}"
{{ else }}
data-host="https://cusdis.com"
{{ end }}
data-app-id="{{ .Site.Params.comments.cusdis.id }}"
data-page-id="{{ .File.UniqueID }}"
data-page-url="{{ .Permalink }}"
data-page-title="{{ .Title }}"></div>
<script async defer src="https://cusdis.com/js/cusdis.es.js"></script>
<script>
function setCusdisTheme(theme) {
let cusdis = document.querySelector('#cusdis_thread iframe');
if (cusdis) {
window.CUSDIS.setTheme(theme)
}
}
window.addEventListener('onColorSchemeChange', (e) => {
setCusdisTheme(e.detail)
})
</script>

View File

@ -0,0 +1,30 @@
{{- with .Site.Params.comments.gitalk -}}
<div id="gitalk-container"></div>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.css"
/>
<script src="https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.18.0/js/md5.min.js"></script>
<script>
const gitalk = new Gitalk({
clientID: "{{- .clientID -}}",
clientSecret: "{{- .clientSecret -}}",
repo: "{{- .repo -}}",
owner: "{{- .owner -}}",
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
});
(function () {
if (
["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1
) {
document.getElementById("gitalk-container").innerHTML =
"Gitalk comments not available by default when the website is previewed locally.";
return;
}
gitalk.render("gitalk-container");
})();
</script>
{{ end }}

View File

@ -13,7 +13,7 @@
{{ end }}
<div class="video-wrapper">
<iframe src="//player.bilibili.com/player.html?{{ $basicQuery | safeURL }}&{{ $videoQuery | safeURL }}"
<iframe src="https://player.bilibili.com/player.html?{{ $basicQuery | safeURL }}&{{ $videoQuery | safeURL }}"
scrolling="no"
frameborder="no"
framespacing="0"

View File

@ -1,6 +1,6 @@
{{ $vid := .Get 0 }}
<div class="video-wrapper">
<iframe src="http://v.qq.com/txp/iframe/player.html?vid={{ $vid }}&auto=0"
<iframe src="https://v.qq.com/txp/iframe/player.html?vid={{ $vid }}&auto=0"
scrolling="no"
frameborder="no"
framespacing="0"

View File

@ -1,13 +1,14 @@
{{- $src := .Get "src" | default (.Get 0) -}}
<div class="video-wrapper">
<video
controls
src="{{- $src -}}"
{{ with .Get "poster" }}poster="{{- . -}}"{{ end }}
{{ with .Get "src" }}src="{{- . -}}"{{ end }}
{{ with .Get "autoplay" }}autoplay{{ end }}
>
<p>
Your browser doesn't support HTML5 video. Here is a
<a href="{{ with .Get "src" }}{{- . -}}{{ end }}">link to the video</a> instead.
<a href="{{- $src -}}">link to the video</a> instead.
</p>
</video>
</div>

View File

@ -6,7 +6,7 @@ license = "GPL-3.0-only"
licenselink = "https://github.com/CaiJimmy/hugo-theme-stack/blob/master/LICENSE"
description = "Card-style Hugo theme designed for bloggers"
homepage = "https://github.com/CaiJimmy/hugo-theme-stack"
demosite = "https://theme-stack.jimmycai.com"
demosite = "https://demo.stack.jimmycai.com"
tags = ["blog", "responsive", "clean", "light", "dark", "personal"]