Compare commits

...
7 Commits
Author SHA1 Message Date
Jimmy Cai 3e123a30b7 release: 4.0.3 2026-05-25 10:44:02 +02:00
JimmyandGitHub e409eddf5c fix: update TOC manual disable check to read default site parameter (#1341)
* fix: update TOC manual disable check to read default site parameter

* Article -> article

* Undo formatting

* fix: simplify TOC enabled logic by removing manual disable check
2026-05-25 10:43:36 +02:00
Jimmy Cai 03bf8b0c3f release: 4.0.2 2026-05-03 22:52:01 +02:00
powerfullzandGitHub e294e4ed70 fix: Firefox fallback breaks right-edge fade in related content (#1332)
* fix: Firefox fallback breaks right-edge fade in related content (#133X)

Firefox does not support scroll-driven animations by default, causing
the animation to fall back to a 0s time-based animation that jumps to
the last keyframe — flipping the fade from right to left.

Wrap animation properties in @supports (animation-timeline: scroll())
so Firefox degrades gracefully to a static right-edge fade.

* chore: fix identation

* fix: add back wrongly deleted props
2026-05-03 22:50:35 +02:00
d3eacc9daf fix: Hugo language related deprecation (v0.158.0+) (#1334)
* language related deprecation fix

Reference: https://github.com/gohugoio/hugo/releases/tag/v0.158.0
.Site.LanguageCode -> .Site.Language.Locale
.Language.LanguageDirection -> .Language.Direction
.Language.LanguageCode -> .Language.Locale

Also, in the configuration hugo.toml, the user should change `languageCode` to `locale`.

* Update languageCode to locale in configuration

* fix(languages): update languageName to label in languages.toml

* .Language.LanguageName -> .Language.Label

* .Language.Lang -> .Language.Name

---------

Co-authored-by: Jimmy Cai <jimmy@cai.im>
2026-05-03 22:49:42 +02:00
Jimmy Cai c0f57bab7a release: 4.0.1 2026-04-26 20:21:35 +02:00
JimmyandGitHub 752fd5805f fix(image): correct permalink handling for images placed in static folder (#1330)
* fix(image): correct permalink handling for images placed in `static` folder

related: https://github.com/CaiJimmy/hugo-theme-stack/discussions/1307

* Remove urls.AbsURL
2026-04-26 20:20:51 +02:00
10 changed files with 37 additions and 31 deletions
+13 -8
View File
@@ -95,18 +95,11 @@
-webkit-mask-image: var(--subsection-mask-image);
mask-image: var(--subsection-mask-image);
// CSS-only: left fade ramps in quickly once horizontal scrolling starts,
// and right fade turns off near the end of horizontal scroll.
animation: subsection-left-fade linear both, subsection-right-fade linear both;
animation-timeline: scroll(self inline);
animation-range: 1px 24px, 0% 100%;
animation-timing-function: ease-out, linear;
[dir="rtl"] & {
margin-left: calc(var(--overlap-x) * -1);
margin-right: calc(var(--overlap-x) * -1);
}
.article-list--tile {
display: flex;
padding: var(--spacing-xs) var(--overlap-x) var(--shadow-overlap-y) var(--overlap-x);
@@ -132,6 +125,18 @@
}
}
// Only apply scroll-driven edge fades in browsers that support scroll timelines.
// Browsers without support (e.g. Firefox) fall back to the static right-edge fade
// defined by the explicit CSS variable declarations above.
@supports (animation-timeline: scroll(self inline)) {
.subsection-list {
animation: subsection-left-fade linear both, subsection-right-fade linear both;
animation-timeline: scroll(self inline);
animation-range: 1px 24px, 0% 100%;
animation-timing-function: ease-out, linear;
}
}
@keyframes subsection-left-fade {
from {
--left-edge-fade-size: 0px;
+1 -1
View File
@@ -1,5 +1,5 @@
baseURL = "https://demo.stack.cai.im/"
languageCode = "en-us"
locale = "en-us"
title = "Hugo Theme Stack"
# Theme i18n support
# See i18n folder for available languages
+12 -12
View File
@@ -1,31 +1,31 @@
[en]
languageName = "English"
title = "Hugo Theme Stack"
weight = 1
label = "English"
title = "Hugo Theme Stack"
weight = 1
[en.params.sidebar]
subtitle = "Card-style Hugo theme designed for bloggers"
[zh]
languageName = "简体中文"
title = "Hugo 主题 Stack"
weight = 2
label = "简体中文"
title = "Hugo 主题 Stack"
weight = 2
[zh.params.sidebar]
subtitle = "为博客设计的卡片式 Hugo 主题"
[zh-hant-tw]
languageName = "正體中文"
title = "Hugo 主題 Stack"
weight = 3
label = "正體中文"
title = "Hugo 主題 Stack"
weight = 3
[zh-hant-tw.params.sidebar]
subtitle = "為博客設計的卡片式 Hugo 主題"
[ja]
languageName = "日本語"
title = "Hugo Theme Stack"
weight = 4
label = "日本語"
title = "Hugo Theme Stack"
weight = 4
[ja.params.sidebar]
subtitle = "ブログ用のカードスタイルの Hugo テーマ"
@@ -58,7 +58,7 @@
<div class="inline-meta">
{{ partial "helper/icon" "language" }}
{{ range $Page.Translations }}
<a href="{{ .RelPermalink }}" class="link">{{ .Language.LanguageName }}</a>
<a href="{{ .RelPermalink }}" class="link">{{ .Language.Label }}</a>
{{ end }}
</div>
{{ end }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- $ThemeVersion := "4.0.0" -}}
{{- $ThemeVersion := "4.0.3" -}}
<footer class="site-footer">
<section class="copyright">
&copy;
+3 -1
View File
@@ -14,12 +14,14 @@
{{ if .Image }}
{{ $url := urls.Parse .Image }}
{{ $permalink := .Image }}
{{ $resource := dict
{{ $result = dict
"Resource" nil
"Permalink" $permalink
"Height" nil
"Width" nil
}}
{{ $resource := dict }}
{{ $local := true }}
{{ if not (in (slice "https" "http") $url.Scheme) }}
+3 -3
View File
@@ -64,7 +64,7 @@
{{ end }}
<li class="menu-bottom-section">
<ol class="menu">
{{- $currentLanguageCode := .Language.Lang -}}
{{- $currentLanguageCode := .Language.Name -}}
{{ if hugo.IsMultilingual }}
<li id="i18n-switch">
{{ partial "helper/icon" "language" }}
@@ -72,11 +72,11 @@
{{ range .Site.Home.AllTranslations }}
{{ $target := . }}
{{ range $.AllTranslations }}
{{ if eq .Language.Lang $target.Language.Lang }}
{{ if eq .Language.Name $target.Language.Name }}
{{ $target = . }}
{{ end }}
{{ end }}
<option value="{{ $target.RelPermalink }}" {{ if eq $target.Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
<option value="{{ $target.RelPermalink }}" {{ if eq $target.Language.Name $currentLanguageCode }}selected{{ end }}>{{ .Language.Label }}</option>
{{ end }}
</select>
</li>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}" dir="{{ default `ltr` .Language.LanguageDirection }}">
<html lang="{{ .Site.Language.Locale }}" dir="{{ default `ltr` .Language.Direction }}">
<head>
{{- partial "head/head.html" . -}}
{{- block "head" . -}}{{ end }}
+1 -1
View File
@@ -30,7 +30,7 @@
<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>
<language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }}
<language>{{ site.Language.Locale }}</language>{{ with $authorEmail }}
<managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
+1 -2
View File
@@ -15,8 +15,7 @@
{{- end -}}
{{- end -}}
{{- $TOCManuallyDisabled := eq .Params.toc false -}}
{{- $TOCEnabled := and (not $TOCManuallyDisabled) $TOCWidgetEnabled -}}
{{- $TOCEnabled := and (default .Site.Params.article.toc .Params.toc) $TOCWidgetEnabled -}}
{{- $hasTOC := ge (len .TableOfContents) 100 -}}
{{- .Scratch.Set "TOCEnabled" (and $TOCEnabled $hasTOC) -}}