Commit 99c4b5fb authored by Baptiste MOINE's avatar Baptiste MOINE 🐼

Add conditional timestamp display

parent a5c765af
Pipeline #54939096 failed with stage
in 24 seconds
......@@ -5,6 +5,7 @@ draft: false
sharingicons: false
menu: "navbar"
weight: 1
timestamp: false
---
Nous sommes les **Cyber'Pilots**, une association à but non lucratif créée par trois étudiants dans le but de participer à l'édition 2019 du **raid-aventure solidaire Europ'Raid**.
......
......@@ -5,6 +5,7 @@ draft: false
sharingicons: false
menu: "navbar"
weight: 2
timestamp: false
---
Envoyez-nous un message en utilisant le formulaire ci-dessous et nous vous recontacterons avec les informations dont vous avez besoin.
......
{{ define "title" }}{{ .Title | markdownify }} | {{ .Site.Title }}{{ end }}
{{ define "schema-dot-org" }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
{{- /* Google recommends the headline be no more than 110 characters */}}
"headline": "{{ substr .Title 0 110 }}",
{{- with .Params.images -}}{{ range first 1 . }}
"image": {
"@type": "ImageObject",
"url": "{{ . | absURL }}"
{{- /* Don't try to get imageConfig if image param is not local */ -}}
{{- if not (or (hasPrefix . "http://") (hasPrefix . "https://")) -}}
{{- with (imageConfig (printf "/static/%s" .)) -}}
,
"height": "{{ .Height }}",
"width": "{{ .Width }}"
{{- end -}}
{{ end }}
},
{{- end -}}{{ end }}
"url": "{{ printf "%s" .Permalink }}",
"wordCount": "{{ .WordCount }}",
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- if not .PublishDate.IsZero }}
"datePublished": "{{ .PublishDate.Format $ISO8601 }}",
{{- else }}
"datePublished": "{{ .Date.Format $ISO8601 }}",
{{- end }}
{{- if not .Lastmod.IsZero }}
"dateModified": "{{ .Lastmod.Format $ISO8601 }}",
{{- end }}
{{- with .Site.Social.GooglePlus }}
"publisher": "{{ printf "%s" . }}",
{{- end }}
"author": {
"@type": "Person",
"name": "{{ .Params.author | default .Site.Params.author }}"
}
{{- if or (.Params.keywords) (or (.Params.categories) (.Params.tags)) -}}
,
"keywords": "{{ delimit (union .Params.keywords (union .Params.categories .Params.tags)) ", " }}"
{{- end }}
{{- with .Params.description -}}
,
"description": "{{ . }}"
{{- end }}
}
</script>
{{ end }}
{{ define "main" }}
{{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }}
<article class="blog-post">
<header>
<h2 class="blog-post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
{{ if (ne ($.Param "timestamp") false) }}
<p class="blog-post-meta"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format $dateFormat }}</time> by {{ .Params.author | default .Site.Params.author }}{{ if or (.Params.categories) (.Params.tags) }} in {{ partial "meta-terms.html" . }}{{ end }}</p>
{{ end }}
</header>
{{ .Content }}
{{ if .IsTranslated }}
<h4>{{ i18n "translations" }}</h4>
<ul>
{{ range .Translations }}
<li>
<a href="{{ .Permalink }}">{{ .Lang }}: {{ .Title }}{{ if .IsPage }}{{ end }}</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ if or (ne ($.Param "sharingicons") false) (.Site.DisqusShortname) }}
<hr>
<footer>
{{ if (ne ($.Param "sharingicons") false) }}
{{ partial "sharing-icons.html" . }}
{{ end }}
{{ if and (.Site.DisqusShortname) (ne .Params.comments false) }}
{{ template "_internal/disqus.html" . }}
{{ end }}
</footer>
{{ end }}
</article> <!-- /.blog-post -->
{{ end }}
{{- /* vim: set ts=2 sw=2 et: */}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment