2024-03-25 07:02:47 +08:00
|
|
|
{{ define "body-class" }}template-archives template-search{{ end }}
|
|
|
|
{{ define "head" }}
|
|
|
|
{{- with .OutputFormats.Get "json" -}}
|
|
|
|
<link rel="preload" href="{{ .RelPermalink }}" as="fetch" crossorigin="anonymous">
|
|
|
|
{{- end -}}
|
|
|
|
{{ end }}
|
2020-08-22 19:20:08 +08:00
|
|
|
{{ define "main" }}
|
2024-03-25 07:02:47 +08:00
|
|
|
{{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}}
|
|
|
|
{{- $terms := $taxonomy.Pages -}}
|
|
|
|
{{ if $terms }}
|
2022-03-04 06:11:19 +08:00
|
|
|
<header>
|
|
|
|
<h2 class="section-title">{{ $taxonomy.Title }}</h2>
|
|
|
|
<div class="subsection-list">
|
|
|
|
<div class="article-list--tile">
|
|
|
|
{{ range $terms }}
|
|
|
|
{{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "taxonomy") }}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
2020-08-22 19:20:08 +08:00
|
|
|
</div>
|
2022-03-04 06:11:19 +08:00
|
|
|
</header>
|
2024-03-25 07:02:47 +08:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
<form id="search-form" action="{{ .RelPermalink }}" class="search-form"{{ with .OutputFormats.Get "json" -}} data-json="{{ .RelPermalink }}"{{- end }}>
|
|
|
|
<p>
|
|
|
|
<label>{{ T "search.title" }}</label>
|
|
|
|
<input name="keyword" placeholder="{{ T `search.placeholder` }}" />
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<button title="{{ T `search.title` }}">
|
|
|
|
{{ partial "helper/icon" "search" }}
|
|
|
|
</button>
|
|
|
|
</form>
|
2020-08-22 19:20:08 +08:00
|
|
|
|
2024-03-25 07:02:47 +08:00
|
|
|
<h3 class="search-result--title section-title"></h3>
|
|
|
|
|
2020-09-12 16:33:53 +08:00
|
|
|
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
2022-06-12 19:42:35 +08:00
|
|
|
|
|
|
|
{{ range $pages.GroupByDate "2006" }}
|
2020-09-12 16:33:53 +08:00
|
|
|
{{ $id := lower (replace .Key " " "-") }}
|
2020-09-13 17:22:47 +08:00
|
|
|
<div class="archives-group" id="{{ $id }}">
|
2020-11-01 06:24:58 +08:00
|
|
|
<h2 class="archives-date section-title"><a href="{{ $.RelPermalink }}#{{ $id }}">{{ .Key }}</a></h2>
|
2020-09-12 16:33:53 +08:00
|
|
|
<div class="article-list--compact">
|
|
|
|
{{ range .Pages }}
|
|
|
|
{{ partial "article-list/compact" . }}
|
|
|
|
{{ end }}
|
2020-08-22 19:20:08 +08:00
|
|
|
</div>
|
2020-09-12 16:33:53 +08:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
2020-08-22 19:20:08 +08:00
|
|
|
|
2020-09-12 16:33:53 +08:00
|
|
|
{{ partialCached "footer/footer" . }}
|
2024-03-25 07:02:47 +08:00
|
|
|
|
|
|
|
<script>
|
|
|
|
window.searchResultTitleTemplate = "{{ T `search.resultTitle` }}"
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{{- $opts := dict "minify" hugo.IsProduction -}}
|
|
|
|
{{- $archivesScript := resources.Get "ts/archives.ts" | js.Build $opts -}}
|
|
|
|
<script type="text/javascript" src="{{ $archivesScript.RelPermalink }}" defer></script>
|
2020-12-11 23:11:47 +08:00
|
|
|
{{ end }}
|
2024-03-25 07:02:47 +08:00
|
|
|
|
|
|
|
{{ define "right-sidebar" }}
|
|
|
|
{{ partial "sidebar/right.html" (dict "Context" . "Scope" "homepage") }}
|
|
|
|
{{ end }}
|