Split duplicated .page-list div into separate partial

This commit is contained in:
BBaoVanC 2022-05-06 21:14:42 -05:00
parent a9d1c25ee4
commit 805dc65ccb
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
10 changed files with 28 additions and 115 deletions

View File

@ -14,19 +14,7 @@
</div>
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ partial "page-list.html" .Paginator.Pages }}
</div>
{{ partial "pagination.html" . }}

View File

@ -79,13 +79,7 @@
<div class="related-posts full-width-page-list">
<hr>
<h1>{{ i18n "related_posts" }}</h1>
<div class="page-list">
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
</div>
{{ partial "page-list.html" . }}
</div>
{{ end }}

View File

@ -7,21 +7,11 @@
{{ partial "post-metadata/author.html" . }}
{{ .Content }}
{{ with .Content }}
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ partial "page-list.html" .Paginator.Pages }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -9,19 +9,7 @@
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ partial "page-list.html" .Paginator.Pages }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -13,19 +13,7 @@
{{ partial "rss-link.html" . }}
</h1>
{{ with (.Paginate .Site.RegularPages).Pages }}
<div class="page-list">
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
</div>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
{{ partial "page-list.html" (.Paginate .Site.RegularPages).Pages }}
{{ partial "pagination.html" . }}
</div>

View File

@ -6,16 +6,6 @@
</h1>
{{ with .Site.RegularPages | first 5 }}
<div class="page-list">
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
</div>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ partial "page-list.html" . }}
{{ end }}
</div>

View File

@ -0,0 +1,13 @@
<div class="page-list">
{{ with . }}
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>

View File

@ -11,24 +11,10 @@
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages.Reverse }}
<ul>
{{ $i := 0 }}
{{ $total := len $.Pages }}
{{ range . }}
{{ $i = add 1 $i }}
{{ .Scratch.Set "series_position" $i }}
{{ .Scratch.Set "series_total" $total }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ with .Paginator.Pages.Reverse }}
{{ partial "page-list.html" . }}
{{ end }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -9,19 +9,7 @@
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ partial "page-list.html" .Paginator.Pages }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -9,19 +9,7 @@
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ partial "page-list.html" .Paginator.Pages }}
{{ partial "pagination.html" . }}
{{ end }}