7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-11-30 01:28:49 +00:00
web-ansol.org/themes/academic/layouts/_default/single.html
Hugo Peixoto c7b1145527 Add event information to event pages
This includes changing the default locale to portuguese so we can
properly format event dates.
2021-09-30 23:21:44 +01:00

50 lines
1.6 KiB
HTML

{{- define "main" -}}
<article class="article">
{{ partial "page_header" . }}
<div class="article-container">
<div class="article-style">
{{ .Content }}
{{ if eq .Params.layout "evento" }}
<h3>Informação do evento</h3>
{{ with .Params.metadata.event.date }}
<p>
<strong>Data:</strong>
{{ if eq (time.Format "2 January 2006" .start) (time.Format "2 January 2006" .finish) }}
{{ if eq (time.Format "15:04" .start) (time.Format "15:04" .finish) }}
{{ time.Format "2 de January de 2006" .start }}
{{ else }}
{{ time.Format "2 de January de 2006" .start }} das
{{ time.Format "15:04" .start }} às
{{ time.Format "15:04" .finish }}
{{ end }}
{{ else if eq (time.Format "January 2006" .start) (time.Format "January 2006" .finish) }}
De {{ time.Format "2" .start }} a {{ time.Format "2 de January de 2006" .finish }}
{{ else }}
De {{ time.Format "2 de January de 2006" .start }} até {{ time.Format "2 de January de 2006" .finish }}
{{ end }}
</p>
{{ end }}
{{ with .Params.metadata.event.site }}
<p><strong>Website:</strong> <a href="{{ .url }}">{{ .title | or .url }}</a></p>
{{ end }}
{{ with .Params.metadata.event.location }}
<p><strong>Local:</strong> {{ . }}</p>
{{ end }}
{{ end }}
</div>
{{ partial "page_footer" . }}
</div>
</article>
{{- end -}}