Move taxonomy related list page to a different file

This commit is contained in:
BBaoVanC 2021-10-15 18:13:14 -05:00
parent a02da46706
commit 40331b4c1c
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
2 changed files with 42 additions and 26 deletions

View File

@ -1,17 +1,5 @@
{{ define "main" }}
{{ if or (eq .Kind "term") (eq .Kind "taxonomy") }}
<h1>
{{ partial "icon.html" "filter" }}
{{ i18n "filtering_for" .Title }}
{{ if eq .Kind "term" }}
<span class="rss-link">
{{ with .OutputFormats.Get "rss" }}
<a href="{{ .Permalink }}">{{ partial "icon.html" "rss" }}</a>
{{ end }}
</span>
{{ end }}
</h1>
{{ else }}
<h1>
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ .Title | markdownify }}
@ -21,18 +9,7 @@
{{ end }}
</span>
</h1>
{{ end }}
{{ if eq .Kind "taxonomy" }}
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
{{ else }}
{{ range .Paginator.Pages }}
{{ .Render "summary" }}
{{ else }}
@ -48,5 +25,3 @@
{{ end }}
{{ end }}
{{ end }}

View File

@ -0,0 +1,41 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "filter" }}
{{ i18n "filtering_for" .Title }}
{{ if eq .Kind "term" }}
<span class="rss-link">
{{ with .OutputFormats.Get "rss" }}
<a href="{{ .Permalink }}">{{ partial "icon.html" "rss" }}</a>
{{ end }}
</span>
{{ end }}
</h1>
{{ if eq .Kind "taxonomy" }}
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
{{ else }}
{{ range .Paginator.Pages }}
{{ .Render "summary" }}
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
{{ if gt .Paginator.TotalPages 1 }}
<div class="pagination">
{{ template "_internal/pagination.html" . }}
</div>
{{ end }}
{{ end }}
{{ end }}