Merge pull request #5 from CaiJimmy/master

Update
This commit is contained in:
Daniel Pessoa 2021-01-01 18:59:07 -03:00 committed by GitHub
commit d1d0616097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 81 additions and 68 deletions

View File

@ -60,7 +60,6 @@ params:
archives: archives:
limit: 5 limit: 5
path: archives
tagCloud: tagCloud:
limit: 10 limit: 10

View File

@ -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

View File

@ -4,10 +4,6 @@ toggleMenu:
darkMode: darkMode:
other: ダークモード other: ダークモード
archives:
categories:
other: 分類
article: article:
relatedContents: relatedContents:
other: 関連するコンテンツ other: 関連するコンテンツ

View File

@ -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

View File

@ -20,10 +20,6 @@ list:
many: Подразделов many: Подразделов
other: Подразделов other: Подразделов
archives:
categories:
other: Категории
article: article:
relatedContents: relatedContents:
other: Также рекомендуем other: Также рекомендуем

View File

@ -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

View File

@ -4,10 +4,6 @@ toggleMenu:
darkMode: darkMode:
other: 暗色模式 other: 暗色模式
archives:
categories:
other: 分类
article: article:
relatedContents: relatedContents:
other: 相关文章 other: 相关文章

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -1,3 +1,6 @@
{{- $query := first 1 (where .Site.Pages "Layout" "==" "archives") -}}
{{- if $query -}}
{{- $archivesPage := index $query 0 -}}
<section class="widget archives"> <section class="widget archives">
<div class="widget-icon"> <div class="widget-icon">
{{ partial "helper/icon" "infinity" }} {{ partial "helper/icon" "infinity" }}
@ -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 }}
@ -25,3 +28,6 @@
{{ end }} {{ end }}
</div> </div>
</section> </section>
{{- else -}}
{{- warnf "Archives page not found. Create a page with layout: archives." -}}
{{- end -}}

View File

@ -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 -}}