thewwwdotcom-blog/themes/anatole/layouts/index.html

98 lines
2.8 KiB
HTML
Raw Permalink Normal View History

2024-09-21 14:24:25 -04:00
{{ define "main" }}
<div
class="post {{ with .Site.Params.doNotLoadAnimations }}
.
{{ else }}
animated fadeInDown
{{ end }}"
>
<div class="post__content">
{{ .Content }}
</div>
<!-- (Optional) Home
-- on top of `mainSections` content (aka posts) ;
-- as declared in content/_index.md
One can set `mainSections = [""]` and have the content/_index.md specified here
-->
</div>
{{ if .Params.mainSectionsTitle }}
<div
class="post {{ with .Site.Params.doNotLoadAnimations }}
.
{{ else }}
animated fadeInDown
{{ end }}"
>
<div class="post__content">
<h2>{{ .Params.mainSectionsTitle }}</h2>
</div>
</div>
{{ end }}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
{{ range $paginator.Pages }}
<div
class="post {{ with .Site.Params.doNotLoadAnimations }}
.
{{ else }}
animated fadeInDown
{{ end }}"
>
{{ if .Params.thumbnail }}
<div class="post__thumbnail-wrapper">
<a href="{{ .RelPermalink }}">
<img class="post__thumbnail" src="{{ .Params.thumbnail | relURL }}" alt="Thumbnail image" loading="lazy" />
</a>
</div>
{{ end }}
<div class="post__content">
<h3><a href="{{ .RelPermalink }}">{{ upper .Title }}</a></h3>
{{ if .Site.Params.fullPostContent }}
<p>{{ .Content | markdownify }}</p>
{{ else }}
<p>{{ .Summary | markdownify }}</p>
{{ end }}
<!-- add read more -->
{{- if and (.Truncated) (.Site.Params.readMore) -}}
<a href="{{ .RelPermalink }}">{{ i18n "read_more" }}</a>
{{- end -}}
</div>
<!-- -->
<div class="post__footer">
<em class="fas fa-calendar-day"></em>
<span class="post__footer-date"
>{{ if isset .Site.Params "indexdateformat" }}
{{ if .Site.Params.localizedDates }}
{{ time.Format .Site.Params.indexDateFormat .Date }}
{{ else }}
{{ .Date.Format .Site.Params.indexDateFormat }}
{{ end }}
{{ else }}
{{ if .Site.Params.localizedDates }}
{{ time.Format "Mon, Jan 2, 2006" .Date }}
{{ else }}
{{ .Date.Format "Mon, Jan 2, 2006" }}
{{ end }}
{{ end }}</span
>
{{ with .Page.Params.Categories }}
{{ partial "taxonomy/categories.html" . }}
{{ end }}
{{ with .Page.Params.Tags }}
{{ partial "taxonomy/tags.html" . }}
{{ end }}
</div>
</div>
{{ end }}
<div class="pagination">
{{ template "partials/pagination.html" . }}
</div>
{{ end }}