mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 12:03:31 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
4094233034
@ -9,6 +9,8 @@ class StackColorScheme {
|
|||||||
this.bindMatchMedia();
|
this.bindMatchMedia();
|
||||||
this.currentScheme = this.getSavedScheme();
|
this.currentScheme = this.getSavedScheme();
|
||||||
|
|
||||||
|
this.dispatchEvent(document.body.dataset.scheme as colorScheme);
|
||||||
|
|
||||||
if (toggleEl)
|
if (toggleEl)
|
||||||
this.bindClick(toggleEl);
|
this.bindClick(toggleEl);
|
||||||
|
|
||||||
|
@ -60,7 +60,6 @@ params:
|
|||||||
|
|
||||||
archives:
|
archives:
|
||||||
limit: 5
|
limit: 5
|
||||||
path: archives
|
|
||||||
|
|
||||||
tagCloud:
|
tagCloud:
|
||||||
limit: 10
|
limit: 10
|
||||||
|
@ -16,10 +16,6 @@ list:
|
|||||||
one: Subsection
|
one: Subsection
|
||||||
other: Subsections
|
other: Subsections
|
||||||
|
|
||||||
archives:
|
|
||||||
categories:
|
|
||||||
other: Categories
|
|
||||||
|
|
||||||
article:
|
article:
|
||||||
relatedContents:
|
relatedContents:
|
||||||
other: Related contents
|
other: Related contents
|
||||||
|
@ -4,10 +4,6 @@ toggleMenu:
|
|||||||
darkMode:
|
darkMode:
|
||||||
other: ダークモード
|
other: ダークモード
|
||||||
|
|
||||||
archives:
|
|
||||||
categories:
|
|
||||||
other: 分類
|
|
||||||
|
|
||||||
article:
|
article:
|
||||||
relatedContents:
|
relatedContents:
|
||||||
other: 関連するコンテンツ
|
other: 関連するコンテンツ
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
toggleMenu:
|
toggleMenu:
|
||||||
other: Alternar Menu
|
other: Alternar Menu
|
||||||
|
|
||||||
archives:
|
darkMode:
|
||||||
categories:
|
other: Modo Escuro
|
||||||
other: Categorias
|
|
||||||
|
list:
|
||||||
|
page:
|
||||||
|
one: "{{ .Count }} página"
|
||||||
|
other: "{{ .Count }} páginas"
|
||||||
|
|
||||||
|
section:
|
||||||
|
other: Seção
|
||||||
|
|
||||||
|
subsection:
|
||||||
|
one: Subseção
|
||||||
|
other: Subseções
|
||||||
|
|
||||||
article:
|
article:
|
||||||
relatedContents:
|
relatedContents:
|
||||||
|
16
i18n/ru.yaml
16
i18n/ru.yaml
@ -12,17 +12,13 @@ list:
|
|||||||
other: "{{ .Count }} страниц"
|
other: "{{ .Count }} страниц"
|
||||||
|
|
||||||
section:
|
section:
|
||||||
other: Разделы
|
other: Раздел
|
||||||
|
|
||||||
subsection:
|
subsection:
|
||||||
one: Подраздел
|
one: Подраздел
|
||||||
few: Подраздела
|
few: Подразделы
|
||||||
many: Подразделов
|
many: Подразделы
|
||||||
other: Подразделов
|
other: Подразделы
|
||||||
|
|
||||||
archives:
|
|
||||||
categories:
|
|
||||||
other: Категории
|
|
||||||
|
|
||||||
article:
|
article:
|
||||||
relatedContents:
|
relatedContents:
|
||||||
@ -32,7 +28,7 @@ article:
|
|||||||
|
|
||||||
notFound:
|
notFound:
|
||||||
title:
|
title:
|
||||||
other: Не найшено
|
other: Не найдено
|
||||||
subtitle:
|
subtitle:
|
||||||
other: Запрашиваемая страница не существует
|
other: Запрашиваемая страница не существует
|
||||||
|
|
||||||
@ -58,4 +54,4 @@ footer:
|
|||||||
builtWith:
|
builtWith:
|
||||||
other: Создано при помощи {{ .Generator }}
|
other: Создано при помощи {{ .Generator }}
|
||||||
designedBy:
|
designedBy:
|
||||||
other: Тема {{ .Theme }} дизайн {{ .DesignedBy }}
|
other: Тема {{ .Theme }}, дизайн {{ .DesignedBy }}
|
||||||
|
@ -16,10 +16,6 @@ list:
|
|||||||
one: Alt bölüm
|
one: Alt bölüm
|
||||||
other: Alt bölümler
|
other: Alt bölümler
|
||||||
|
|
||||||
archives:
|
|
||||||
categories:
|
|
||||||
other: Kategoriler
|
|
||||||
|
|
||||||
article:
|
article:
|
||||||
relatedContents:
|
relatedContents:
|
||||||
other: Alakalı içerikler
|
other: Alakalı içerikler
|
||||||
|
@ -4,10 +4,6 @@ toggleMenu:
|
|||||||
darkMode:
|
darkMode:
|
||||||
other: 暗色模式
|
other: 暗色模式
|
||||||
|
|
||||||
archives:
|
|
||||||
categories:
|
|
||||||
other: 分类
|
|
||||||
|
|
||||||
article:
|
article:
|
||||||
relatedContents:
|
relatedContents:
|
||||||
other: 相关文章
|
other: 相关文章
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
{{ define "body-class" }}template-archives{{ end }}
|
{{ define "body-class" }}template-archives{{ end }}
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{ $categories := ($.Site.GetPage "taxonomyTerm" "categories").Pages }}
|
{{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}}
|
||||||
{{ if $categories }}
|
{{- $terms := $taxonomy.Pages -}}
|
||||||
<h2 class="section-title">{{ T "archives.categories" }}</h2>
|
{{ if $terms }}
|
||||||
|
<h2 class="section-title">{{ $taxonomy.Title }}</h2>
|
||||||
<div class="subsection-list">
|
<div class="subsection-list">
|
||||||
<div class="article-list--tile">
|
<div class="article-list--tile">
|
||||||
{{ range $categories }}
|
{{ range $terms }}
|
||||||
{{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "taxonomy") }}
|
{{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "taxonomy") }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -42,8 +42,17 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ $subsections := .Sections }}
|
{{- $subsections := .Sections -}}
|
||||||
{{ with $subsections }}
|
{{- $pages := .Pages | complement $subsections -}}
|
||||||
|
|
||||||
|
{{- if eq (len $pages) 0 -}}
|
||||||
|
{{/* If there are no normal pages, display subsections in list style, with pagination */}}
|
||||||
|
{{/* This happens with taxonomies like categories or tags */}}
|
||||||
|
{{- $pages = $subsections -}}
|
||||||
|
{{- $subsections = slice -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with $subsections -}}
|
||||||
<h2 class="section-title">{{ T "list.subsection" (len $subsections) }}</h2>
|
<h2 class="section-title">{{ T "list.subsection" (len $subsections) }}</h2>
|
||||||
<div class="subsection-list">
|
<div class="subsection-list">
|
||||||
<div class="article-list--tile">
|
<div class="article-list--tile">
|
||||||
@ -52,10 +61,10 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
||||||
{{/* List only pages that are not a subsection */}}
|
{{/* List only pages that are not a subsection */}}
|
||||||
{{ $paginator := .Paginate (.Pages | complement $subsections) }}
|
{{ $paginator := .Paginate $pages }}
|
||||||
<section class="article-list--compact">
|
<section class="article-list--compact">
|
||||||
{{ range $paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
{{ partial "article-list/compact" . }}
|
{{ partial "article-list/compact" . }}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<input name="keyword" placeholder="{{ T `search.placeholder` }}" />
|
<input name="keyword" placeholder="{{ T `search.placeholder` }}" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button title="Search">
|
<button title="{{ T `search.title` }}">
|
||||||
{{ partial "helper/icon" "search" }}
|
{{ partial "helper/icon" "search" }}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -10,3 +10,13 @@
|
|||||||
padding: var(--card-padding);
|
padding: var(--card-padding);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.addEventListener('onColorSchemeChange', (e) => {
|
||||||
|
if (DISQUS) {
|
||||||
|
DISQUS.reset({
|
||||||
|
reload: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
@ -14,3 +14,18 @@
|
|||||||
max-width: unset;
|
max-width: unset;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.addEventListener('onColorSchemeChange', (e) => {
|
||||||
|
let utterances = document.querySelector('.utterances iframe');
|
||||||
|
if (utterances) {
|
||||||
|
utterances.contentWindow.postMessage(
|
||||||
|
{
|
||||||
|
type: 'set-theme',
|
||||||
|
theme: `github-${e.detail}`
|
||||||
|
},
|
||||||
|
'https://utteranc.es'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
@ -1,27 +1,33 @@
|
|||||||
<section class="widget archives">
|
{{- $query := first 1 (where .Site.Pages "Layout" "==" "archives") -}}
|
||||||
<div class="widget-icon">
|
{{- if $query -}}
|
||||||
{{ partial "helper/icon" "infinity" }}
|
{{- $archivesPage := index $query 0 -}}
|
||||||
</div>
|
<section class="widget archives">
|
||||||
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
|
<div class="widget-icon">
|
||||||
|
{{ partial "helper/icon" "infinity" }}
|
||||||
|
</div>
|
||||||
|
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
|
||||||
|
|
||||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||||
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
||||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
{{ $filtered := ($pages | intersect $notHidden) }}
|
||||||
{{ $archives := $filtered.GroupByDate "2006" }}
|
{{ $archives := $filtered.GroupByDate "2006" }}
|
||||||
|
|
||||||
<div class="widget-archive--list">
|
<div class="widget-archive--list">
|
||||||
{{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }}
|
{{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }}
|
||||||
{{- $id := lower (replace $item.Key " " "-") -}}
|
{{- $id := lower (replace $item.Key " " "-") -}}
|
||||||
<div class="archives-year">
|
<div class="archives-year">
|
||||||
<a href="{{ $.Site.Params.widgets.archives.path | relLangURL }}#{{ $id }}">
|
<a href="{{ $archivesPage.RelPermalink }}#{{ $id }}">
|
||||||
{{ if eq $index $.Site.Params.widgets.archives.limit }}
|
{{ if eq $index $.Site.Params.widgets.archives.limit }}
|
||||||
<span class="year">{{ T "widget.archives.more" }}</span>
|
<span class="year">{{ T "widget.archives.more" }}</span>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<span class="year">{{ .Key }}</span>
|
<span class="year">{{ .Key }}</span>
|
||||||
<span class="count">{{ len $item.Pages }}</span>
|
<span class="count">{{ len $item.Pages }}</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
{{- else -}}
|
||||||
|
{{- warnf "Archives page not found. Create a page with layout: archives." -}}
|
||||||
|
{{- end -}}
|
@ -1,10 +1,16 @@
|
|||||||
<form action="/search" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
|
{{- $query := first 1 (where .Site.Pages "Layout" "==" "search") -}}
|
||||||
<p>
|
{{- if $query -}}
|
||||||
<label>{{ T "search.title" }}</label>
|
{{- $searchPage := index $query 0 -}}
|
||||||
<input name="keyword" required placeholder="{{ T `search.placeholder` }}" />
|
<form action="{{ $searchPage.RelPermalink }}" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
|
||||||
|
<p>
|
||||||
|
<label>{{ T "search.title" }}</label>
|
||||||
|
<input name="keyword" required placeholder="{{ T `search.placeholder` }}" />
|
||||||
|
|
||||||
<button title="Search">
|
<button title="{{ T `search.title` }}">
|
||||||
{{ partial "helper/icon" "search" }}
|
{{ partial "helper/icon" "search" }}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
{{- else -}}
|
||||||
|
{{- warnf "Search page not found. Create a page with layout: search." -}}
|
||||||
|
{{- end -}}
|
Loading…
Reference in New Issue
Block a user