Change `hugo` theme template.

This commit is contained in:
Kazuhiro MUSASHI 2020-01-19 14:24:38 +08:00
parent 0cd252575c
commit 3b7df4e0d3
1 changed files with 16 additions and 14 deletions

View File

@ -5,20 +5,22 @@
-->
<main id="index" role="main">
<div class="article-header light-gray"><h1>Recent Articles</h1></div>
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
{{ $paginator := .Paginate (where .Site.Pages "Type" "post") }}
{{ range $paginator.Pages }}
<div class="summary">
<h2><a href="{{ .Permalink }}">{{ .Title }} {{ if .Draft }}:: DRAFT{{end}}</a></h2>
<div class="meta">
{{ .Date.Format "Jan 2, 2006" }} &nbsp;
{{ range .Params.categories }}
#<a href="/categories/{{ . | urlize }}">{{ . }}</a>&nbsp;
{{ end }}
{{ range .Params.tags }}
#<a href="/tags/{{ . | urlize }}">{{ . }}</a>&nbsp;
{{ end }}: {{ .Description }}
</div>
</div>
{{ if eq .Kind "page" }}
<div class="summary">
<h2><a href="{{ .Permalink }}">{{ .Title }} {{ if .Draft }}:: DRAFT{{end}}</a></h2>
<div class="meta">
{{ .Date.Format "Jan 2, 2006" }} &nbsp;
{{ range .Params.categories }}
#<a href="/categories/{{ . | urlize }}">{{ . }}</a>&nbsp;
{{ end }}
{{ range .Params.tags }}
#<a href="/tags/{{ . | urlize }}">{{ . }}</a>&nbsp;
{{ end }}: {{ .Description }}
</div>
</div>
{{ end }}
{{ end }}
</main>
@ -26,7 +28,7 @@
<!-- Paginator Section Layout
-->
<nav>
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
{{ $paginator := .Paginate (where .Site.Pages "Type" "post") }}
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL }}">Prev</a>
{{ end }}