Update templates and README

This commit is contained in:
panr 2022-10-22 13:29:33 +02:00
parent 996701fde0
commit ea5c6aa798
9 changed files with 75 additions and 56 deletions

View file

@ -15,14 +15,17 @@
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
{{ range $paginator.Pages }}
<div class="post on-list">
<article class="post on-list">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
<div class="post-meta">
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
</span>
{{ with .Date }}
<time class="post-date">
{{ .Format "2006-01-02" }}
</time>
{{ end }}
{{ with .Params.Author }}
<span class="post-author">:: {{ . }}</span>
{{ end }}
@ -38,10 +41,8 @@
</span>
{{ end }}
{{ partial "cover.html" . }}
<div class="post-content">
{{ if .Params.showFullContent }}
{{ .Content }}
@ -53,13 +54,13 @@
</div>
{{ if not .Params.showFullContent }}
<div>
<a class="read-more button"
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
<div>
<a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
{{ end }}
</div>
</article>
{{ end }}
{{ partial "pagination.html" . }}
</div>
{{ end }}

View file

@ -6,16 +6,18 @@
{{ end }}
<div class="posts">
{{ range .Paginator.Pages }}
<div class="post on-list">
<article class="post on-list">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
<div class="post-meta">
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
</span>
{{ with .Date }}
<time class="post-date">
{{ .Format "2006-01-02" }} ::
</time>
{{ end }}
{{ with .Params.Author }}
<span class="post-author">:: {{ . }}</span>
<span class="post-author">{{ . }}</span>
{{ end }}
</div>
@ -31,7 +33,6 @@
{{ partial "cover.html" . }}
<div class="post-content">
{{ if .Params.showFullContent }}
{{ .Content }}
@ -43,13 +44,13 @@
</div>
{{ if not .Params.showFullContent }}
<div>
<a class="read-more button"
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
<div>
<a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
{{ end }}
</div>
</article>
{{ end }}
{{ partial "pagination.html" . }}
</div>
{{ end }}

View file

@ -1,18 +1,19 @@
{{ define "main" }}
<div class="post">
<article class="post">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
<div class="post-meta">
{{ if .Params.Date }}
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
{{ with .Date }}
<time class="post-date">
{{ .Format "2006-01-02" }} ::
{{ if $.Site.Params.showLastUpdated }}
[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
[{{or $.Site.Params.updatedDatePrefix "Updated"}} :: {{ .Lastmod.Format "2006-01-02" }}]
{{ end }}
</span>
</time>
{{ end }}
{{ with .Params.Author }}
<span class="post-author">:: {{ . }}</span>
<span class="post-author">{{ . }}</span>
{{ end }}
{{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
<span class="post-reading-time">:: {{ .ReadingTime }} min read ({{ .WordCount }} words)</span>
@ -20,11 +21,11 @@
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ partial "cover.html" . }}
@ -46,11 +47,11 @@
</div>
{{ if eq .Type $.Site.Params.contentTypeName }}
{{ partial "posts_pagination.html" . }}
{{ partial "posts_pagination.html" . }}
{{ end }}
{{ if not (.Params.hideComments | default false) }}
{{ partial "comments.html" . }}
{{ partial "comments.html" . }}
{{ end }}
</div>
</article>
{{ end }}