This commit is contained in:
Huy Tran 2018-03-30 18:09:06 +11:00
parent ad5f17e77a
commit 26effade34
3 changed files with 9 additions and 22 deletions

View file

@ -8,11 +8,7 @@
<div class="post">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<span class="post-date">
{{- if isset .Site.Params "dateformat" -}}
{{ .Date.Format .Site.Params.dateformat }}
{{- else -}}
{{ .Date.Format "Jan 02 2006" }}
{{- end -}}
{{- .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") -}}
</span>
{{ .Summary }}
{{ if .Truncated }}

View file

@ -6,11 +6,7 @@
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ if not .Date.IsZero }}
<time class="pull-right post-list">
{{- if isset .Site.Params "dateformat" -}}
{{ .Date.Format .Site.Params.dateformat }}
{{- else -}}
{{ .Date.Format "Jan 02 2006" }}
{{- end -}}
{{- .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") -}}
</time>
{{end}}
</span>

View file

@ -5,32 +5,27 @@
<span class="text-left post-date meta">
<!-- published date -->
{{ if not .Date.IsZero }}
<i class="fas fa-calendar-alt"></i>
{{ if isset .Site.Params "dateformat" -}}
{{ .Date.Format .Site.Params.dateformat }}
{{- else -}}
{{ .Date.Format "Jan 02 2006" }}
{{- end -}}
<i class="fas fa-calendar-alt"></i> {{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") -}}
{{ end }}
<!-- categories -->
{{ if isset .Params "categories" }}
{{ $total := len .Params.categories }}
{{ with .Params.categories }}
{{ $total := len . }}
{{ if gt $total 0 }}
in
{{ $total := sub $total 1 }}
{{ range $i, $cat := sort $.Params.categories }}
{{ range $i, $cat := sort . }}
<a class="meta" href="{{ "/categories/" | relURL }}{{ $cat | urlize }}">{{ $cat | upper }}</a>
{{ if lt $i $total }},{{ end }}
{{ end }}
{{ end }}
{{ end }}
<!-- tags -->
{{ if isset .Params "tags" }}
{{ $total := len .Params.tags }}
{{ with .Params.tags }}
{{ $total := len . }}
{{ if gt $total 0 }}
<br/>
{{ $subtotal := sub $total 1 }} <i class="fas fa-tags"></i>
{{ range $i, $tag := sort $.Params.tags }}
{{ range $i, $tag := sort . }}
<a class="meta" href="{{ "/tags/" | relURL }}{{ $tag | urlize }}">{{ $tag | lower }}</a>{{ if lt $i $subtotal }} {{ end }}
{{ end }}
{{ end }}