mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 20:13:31 +08:00
commit
d1d0616097
@ -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,10 +1,6 @@
|
|||||||
toggleMenu:
|
toggleMenu:
|
||||||
other: Alternar Menu
|
other: Alternar Menu
|
||||||
|
|
||||||
archives:
|
|
||||||
categories:
|
|
||||||
other: Categorias
|
|
||||||
|
|
||||||
article:
|
article:
|
||||||
relatedContents:
|
relatedContents:
|
||||||
other: Conteúdos Relacionados
|
other: Conteúdos Relacionados
|
||||||
|
@ -20,10 +20,6 @@ list:
|
|||||||
many: Подразделов
|
many: Подразделов
|
||||||
other: Подразделов
|
other: Подразделов
|
||||||
|
|
||||||
archives:
|
|
||||||
categories:
|
|
||||||
other: Категории
|
|
||||||
|
|
||||||
article:
|
article:
|
||||||
relatedContents:
|
relatedContents:
|
||||||
other: Также рекомендуем
|
other: Также рекомендуем
|
||||||
|
@ -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>
|
||||||
|
@ -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,4 +1,7 @@
|
|||||||
<section class="widget archives">
|
{{- $query := first 1 (where .Site.Pages "Layout" "==" "archives") -}}
|
||||||
|
{{- if $query -}}
|
||||||
|
{{- $archivesPage := index $query 0 -}}
|
||||||
|
<section class="widget archives">
|
||||||
<div class="widget-icon">
|
<div class="widget-icon">
|
||||||
{{ partial "helper/icon" "infinity" }}
|
{{ partial "helper/icon" "infinity" }}
|
||||||
</div>
|
</div>
|
||||||
@ -13,7 +16,7 @@
|
|||||||
{{ 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 }}
|
||||||
@ -24,4 +27,7 @@
|
|||||||
</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") -}}
|
||||||
|
{{- if $query -}}
|
||||||
|
{{- $searchPage := index $query 0 -}}
|
||||||
|
<form action="{{ $searchPage.RelPermalink }}" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
|
||||||
<p>
|
<p>
|
||||||
<label>{{ T "search.title" }}</label>
|
<label>{{ T "search.title" }}</label>
|
||||||
<input name="keyword" required placeholder="{{ T `search.placeholder` }}" />
|
<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