Merge branch 'master' into canary

This commit is contained in:
Jimmy Cai 2024-10-19 21:38:02 +00:00
commit 4b2bfc9c2e
5 changed files with 22 additions and 3 deletions

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

@ -3,12 +3,20 @@ en:
languageName: English
title: Hugo Theme Stack Example Site
weight: 1
params:
sidebar:
subtitle: Example description
zh-cn:
languageName: 中文
title: Hugo 主题 Stack 演示站点
weight: 2
params:
sidebar:
subtitle: 演示说明
ar:
languageName: عربي
languagedirection: rtl
title: موقع تجريبي
weight: 3
sidebar:
subtitle: وصف تجريبي

View file

@ -29,6 +29,12 @@ widget:
title: Archives
more: Autres
tagCloud:
title: Mots clés
categoriesCloud:
title: Catégories
search:
title: Rechercher
placeholder: Cherchez un article, une publication, etc.

View file

@ -11,7 +11,8 @@
data-emit-metadata="{{- default 0 .emitMetadata -}}"
data-input-position="{{- default `top` .inputPosition -}}"
data-theme="{{- default `light` .lightTheme -}}"
data-lang="{{- default `en` .lang -}}"
data-lang="{{- default $.Language.LanguageCode .lang -}}"
data-loading="{{- .loading -}}"
crossorigin="anonymous"
async
></script>

View file

@ -1,10 +1,10 @@
{{- $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 -}}