Datumsformate

This commit is contained in:
Patrick Neff 2019-01-17 12:35:20 +01:00
parent cb1087c87f
commit deabc3ec03
5 changed files with 9 additions and 11 deletions

View File

@ -14,7 +14,7 @@
&nbsp;<a href="{{ .RelPermalink }}">{{ i18n "read-more" }}&#8230;</a>
{{- end -}}
<footer>
<time class="list-item-lastmod" datetime="{{ .Lastmod }}">{{ .Lastmod.Format "02.01.2006 15:04" }}</time>
<time class="list-item-lastmod" datetime='{{ .Lastmod.Format "2006-01-02T15:04-07:00" }}'>{{ .Lastmod.Format "02.01.2006 15:04" }}</time>
</footer>
</div>
</div>

View File

@ -23,8 +23,8 @@
{{ partial "schema/organization.jsonld" (dict "org" . "ctx" $context "short" true) }}
{{- end -}},
"copyrightYear": "{{ .post.Date.Format "2006" }}",
"datePublished": "{{ .post.PublishDate | safeHTML }}",
"dateModified": "{{ .post.Lastmod | safeHTML }}",
"datePublished": {{ .post.PublishDate.Format "2006-01-02T15:04-07:00" | jsonify }},
"dateModified": {{ .post.Lastmod.Format "2006-01-02T15:04-07:00" | jsonify }},
"url": "{{ .post.Permalink }}",
"wordCount": "{{ .post.WordCount }}",
"keywords": "{{ with .post.Keywords }}{{ delimit . ", " }}{{ end }}",

View File

@ -23,12 +23,10 @@
{{ partial "schema/organization.jsonld" (dict "org" . "ctx" $context "short" true) }}
{{- end -}},
"copyrightYear": "{{ .post.Date.Format "2006" }}",
"datePublished": "{{ .post.PublishDate | safeHTML }}",
"dateModified": "{{ .post.Lastmod | safeHTML }}",
"datePublished": {{ .post.PublishDate.Format "2006-01-02T15:04-07:00" | jsonify }},
"dateModified": {{ .post.Lastmod.Format "2006-01-02T15:04-07:00" | jsonify }},
"url": "{{ .post.Permalink }}",
"wordCount": "{{ .post.WordCount }}",
"keywords": "{{ with .post.Keywords }}{{ delimit . ", " }}{{ end }}",
{{ $imageURL := path.Join .post.RelPermalink "bilder/" .post.Params.featuredImage }}
"image": {{ partial "schema/image.jsonld" (dict "url" $imageURL "ctx" .ctx) }},
"articleBody": {{ .ctx.Content | jsonify }}
"articleBody": {{ delimit .post.PlainWords " " | jsonify }}
}

View File

@ -21,7 +21,7 @@
{{ with .ctx.Site.Params.description }}
"description": "{{ . }}",
{{ end }}
"dateModified": "{{ .site.Lastmod }}",
"dateCreated": "{{ .site.PublishDate }}"
"datePublished": {{ .site.PublishDate.Format "2006-01-02T15:04-07:00" | jsonify }},
"dateModified": {{ .site.Lastmod.Format "2006-01-02T15:04-07:00" | jsonify }},
{{ end }}
}

View File

@ -17,6 +17,6 @@
{{- end -}}
<footer class="single-footer padding">
<p>
<i class="fa fa-calendar"></i> <time datetime='{{ .Lastmod.Format "2006-01-02T15:04-06:00" }}'>{{ .Lastmod.Format "02.01.2006 15:04" }}</time>
<i class="fa fa-calendar"></i> <time datetime='{{ .Lastmod.Format "2006-01-02T15:04-07:00" }}'>{{ .Lastmod.Format "02.01.2006 15:04" }}</time>
</p>
</footer>