mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 04:13:17 -06:00
Redo taxonomy template structure
This commit is contained in:
parent
28cf50d3d8
commit
f77efb1843
5
layouts/partials/pagination.html
Normal file
5
layouts/partials/pagination.html
Normal file
@ -0,0 +1,5 @@
|
||||
{{ if gt .Paginator.TotalPages 1 }}
|
||||
<div class="pagination">
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
5
layouts/partials/rss-link.html
Normal file
5
layouts/partials/rss-link.html
Normal file
@ -0,0 +1,5 @@
|
||||
<span class="rss-link">
|
||||
{{ with .OutputFormats.Get "rss" }}
|
||||
<a href="{{ .Permalink }}" target="_blank" rel="noopener">{{ partial "icon.html" "rss-feed" }}</a>
|
||||
{{ end }}
|
||||
</span>
|
5
layouts/partials/term-description.html
Normal file
5
layouts/partials/term-description.html
Normal file
@ -0,0 +1,5 @@
|
||||
{{ with .Description }}
|
||||
<div class="term-description">
|
||||
<p>{{ . | markdownify }}</p>
|
||||
</div>
|
||||
{{ end }}
|
14
layouts/series/list.html
Normal file
14
layouts/series/list.html
Normal file
@ -0,0 +1,14 @@
|
||||
{{ define "main" }}
|
||||
<h1>
|
||||
{{ partial "icon.html" "files" }}
|
||||
{{ .Title | markdownify }}
|
||||
</h1>
|
||||
|
||||
<div class="series-taxonomy">
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>{{ .Render "series-summary" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
23
layouts/series/term.html
Normal file
23
layouts/series/term.html
Normal file
@ -0,0 +1,23 @@
|
||||
{{ define "main" }}
|
||||
<h1>
|
||||
{{ partial "icon.html" "files" }}
|
||||
{{ .Title | markdownify }}
|
||||
{{ partial "rss-link.html" . }}
|
||||
</h1>
|
||||
|
||||
{{ partial "term-description.html" . }}
|
||||
|
||||
<div class="page-list">
|
||||
<ul>
|
||||
{{ range .Paginator.Pages.Reverse }}
|
||||
<li>{{ .Render "summary" }}</li>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
@ -1,38 +1,16 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<h1>
|
||||
{{ if eq .Data.Singular "tag" }}
|
||||
{{ partial "icon.html" "tag" }}
|
||||
{{ else if eq .Data.Singular "author" }}
|
||||
{{ partial "icon.html" "user-circle" }}
|
||||
{{ else if eq .Data.Singular "series" }}
|
||||
{{ partial "icon.html" "files" }}
|
||||
{{ else }}
|
||||
{{ partial "icon.html" "filter" }}
|
||||
{{ end }}
|
||||
|
||||
{{ .Title | markdownify }}
|
||||
|
||||
{{ if eq .Kind "term" }}
|
||||
<span class="rss-link">
|
||||
{{ with .OutputFormats.Get "rss" }}
|
||||
<a href="{{ .Permalink }}" target="_blank" rel="noopener">{{ partial "icon.html" "rss-feed" }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</h1>
|
||||
|
||||
{{ if eq .Kind "taxonomy" }}
|
||||
|
||||
{{ if eq .Data.Singular "series" }}
|
||||
<div class="series-taxonomy">
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>{{ .Render "series-summary" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="taxonomy">
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
@ -43,39 +21,3 @@
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ else }}
|
||||
|
||||
|
||||
{{ with .Description }}
|
||||
<div class="term-description">
|
||||
<p>{{ . | markdownify }}</p>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ $items := .Paginator.Pages }}
|
||||
{{ if eq .Data.Singular "series" }}
|
||||
{{ $items = .Paginator.Pages.Reverse }}
|
||||
{{ end }}
|
||||
<div class="page-list">
|
||||
<ul>
|
||||
{{ range $items }}
|
||||
<li>{{ .Render "summary" }}</li>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
{{ if gt .Paginator.TotalPages 1 }}
|
||||
<div class="pagination">
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
29
layouts/taxonomy/term.html
Normal file
29
layouts/taxonomy/term.html
Normal file
@ -0,0 +1,29 @@
|
||||
{{ define "main" }}
|
||||
<h1>
|
||||
{{ if eq .Data.Singular "tag" }}
|
||||
{{ partial "icon.html" "tag" }}
|
||||
{{ else if eq .Data.Singular "author" }}
|
||||
{{ partial "icon.html" "user-circle" }}
|
||||
{{ else }}
|
||||
{{ partial "icon.html" "filter" }}
|
||||
{{ end }}
|
||||
|
||||
{{ .Title | markdownify }}
|
||||
{{ partial "rss-link.html" . }}
|
||||
</h1>
|
||||
|
||||
{{ partial "term-description.html" . }}
|
||||
<div class="page-list">
|
||||
<ul>
|
||||
{{ range .Paginator.Pages }}
|
||||
<li>{{ .Render "summary" }}</li>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
Loading…
Reference in New Issue
Block a user