Použít parametr "eventdate" u stránek typu "event"
This commit is contained in:
parent
5dc7866d5c
commit
e43f73ab95
|
@ -11,7 +11,14 @@
|
|||
<div class="flex">
|
||||
<a href="{{ .Permalink }}" class="truncate">{{ .Title }}</a>
|
||||
{{ if eq .Kind "page" }}
|
||||
<time class="nowrap" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "2. 1. 2006" }}</time>
|
||||
{{ if eq .Type "event" -}}
|
||||
{{ with .Params.eventdate }}
|
||||
{{ $d := . | time.AsTime }}
|
||||
<time class="nowrap" datetime="{{ $d.Format "2006-01-02T15:04:05Z0700" }}">{{ $d.Format "2. 1. 2006" }}</time>
|
||||
{{ end }}
|
||||
{{- else }}
|
||||
<time class="nowrap" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "2. 1. 2006" }}</time>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -4,11 +4,19 @@
|
|||
<h1 class="title">{{ .Title }}</h1>
|
||||
{{ with .Params.tagline }}<span class="tagline">{{ . }}</span>{{ end }}
|
||||
|
||||
{{ if ne .Type "page" -}}
|
||||
{{ if not (in (slice "page" "event") .Type) -}}
|
||||
<div class="post-date">
|
||||
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "2. 1. 2006" }}</time>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{ if eq .Type "event" -}}
|
||||
{{ with .Params.eventdate }}
|
||||
{{ $d := . | time.AsTime }}
|
||||
<div class="event-date">
|
||||
<time datetime="{{ $d.Format "2006-01-02T15:04:05Z0700" }}">{{ $d.Format "2. 1. 2006" }}</time>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end}}
|
||||
|
||||
<div>
|
||||
{{ .Content }}
|
||||
|
|
Loading…
Reference in New Issue