mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-13 01:57:28 -05:00
Improve list pages + support "series"
- Use a <ul>: better accessibility - Background for individual pages in the list, giving a better feeling of separation - Support "series" taxonomy (displayed oldest to newest)
This commit is contained in:
@ -10,8 +10,9 @@
|
||||
</span>
|
||||
</h1>
|
||||
|
||||
{{ with .Sections }}
|
||||
<div class="sections">
|
||||
{{ range .Sections }}
|
||||
{{ range . }}
|
||||
|
||||
<a class="section-anchor" href="{{ .Permalink }}">
|
||||
<div class="section">
|
||||
@ -34,13 +35,18 @@
|
||||
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="posts">
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ .Render "summary" }}
|
||||
{{ else }}
|
||||
{{ i18n "no_posts" }}
|
||||
{{ end }}
|
||||
<div class="page-list">
|
||||
<ul>
|
||||
{{ range .Paginator.Pages }}
|
||||
<li>{{ .Render "summary" }}</li>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{ if gt .Paginator.TotalPages 1 }}
|
||||
|
@ -74,6 +74,17 @@
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.series }}
|
||||
<div class="series">
|
||||
{{ range ($.GetTerms "series") }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "files" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="tags">
|
||||
{{ range (.GetTerms "tags") }}
|
||||
<span class="post-meta-item">
|
||||
|
@ -5,6 +5,8 @@
|
||||
{{ 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 }}
|
||||
@ -30,13 +32,24 @@
|
||||
</ul>
|
||||
|
||||
{{ else }}
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ .Render "summary" }}
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
|
||||
|
||||
{{ $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">
|
||||
|
Reference in New Issue
Block a user