You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
6.9 KiB
HTML
130 lines
6.9 KiB
HTML
{{ $page := . }}
|
|
|
|
{{ $class := "mb-0 text-center" }}
|
|
|
|
{{ if $page.Pages }}
|
|
{{ if $page.Param "paige.list.content.show" }}
|
|
{{ $p := $page.Paginate $page.Pages }}
|
|
<section>
|
|
{{ range $p.Pages }}
|
|
{{ $page.Scratch.Set "paige_list_show_content" true }}
|
|
{{ partial "paige/article.html" . }}
|
|
{{ end }}
|
|
</section>
|
|
{{ if or $p.HasPrev $p.HasNext }}
|
|
<section>
|
|
<div class="d-flex justify-content-center">
|
|
{{ partial "paige/pagination.html" $page }}
|
|
</div>
|
|
</section>
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ $p := $page.Paginate ($page.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
|
|
<section>
|
|
{{ range $p.PageGroups }}
|
|
{{ if $page.Param "paige.list.date_header.hide" | not }}
|
|
<h2 class="{{ $.Param `paige.list.date_header.class` | default `h5 text-center` }}">{{ .Key }}</h2>
|
|
{{ end }}
|
|
{{ range .Pages }}
|
|
{{ $authors := cond ($page.Param "paige.list.authors.hide" | not) (partial "paige/func-authors.html" .) "" }}
|
|
{{ $authorsclass := $page.Param "paige.list.authors.class" | default (print $class " text-secondary") }}
|
|
{{ $categories := cond ($page.Param "paige.list.terms.hide" | not) (.Params.categories | default slice) slice | sort | uniq }}
|
|
{{ $date := cond ($page.Param "paige.list.date.hide" | not) .PublishDate "" }}
|
|
{{ $dateclass := $page.Param "paige.list.date.class" | default (print $class " text-secondary") }}
|
|
{{ $dateformat := $page.Param "paige.list.date.format" | default ":date_long" }}
|
|
{{ $description := cond ($page.Param "paige.list.description.hide" | not) (.Description | markdownify) "" }}
|
|
{{ $descriptionclass := $page.Param "paige.list.description.class" | default $class }}
|
|
{{ $draft := .Draft }}
|
|
{{ $expired := and .ExpiryDate (lt .ExpiryDate now) }}
|
|
{{ $flags := slice }}
|
|
{{ $future := and .PublishDate (gt .PublishDate now) }}
|
|
{{ $modified := and .PublishDate .Lastmod (lt .PublishDate .Lastmod) }}
|
|
{{ $readingtime := cond ($page.Param "paige.list.reading_time.hide" | not) .ReadingTime "" }}
|
|
{{ $readingtimeclass := $page.Param "paige.list.reading_time.class" | default (print $class " text-secondary") }}
|
|
{{ $sectionclass := $page.Param "paige.list.section.class" | default "mb-3 w-100" }}
|
|
{{ $summary := cond ($page.Param "paige.list.summary.hide" | not) (.Summary | strings.TrimPrefix "<p>" | strings.TrimSuffix "</p>" | htmlUnescape | plainify) "" }}
|
|
{{ $summaryclass := $page.Param "paige.list.summary.class" | default (print "fst-italic " $class) }}
|
|
{{ $tags := cond ($page.Param "paige.list.terms.hide" | not) (.Params.tags | default slice) slice | sort | uniq }}
|
|
{{ $termsinnerclass := $page.Param "paige.list.terms.inner_class" | default "badge text-bg-secondary text-decoration-none" }}
|
|
{{ $termsouterclass := $page.Param "paige.list.terms.outer_class" | default $class }}
|
|
{{ $title := cond ($page.Param "paige.list.title.hide" | not) (.Title | markdownify) "" }}
|
|
{{ $titleclass := $page.Param "paige.list.title.class" | default $class }}
|
|
{{ $titlelink := .RelPermalink }}
|
|
|
|
{{ if $draft }}
|
|
{{ $flags = $flags | append "paige-draft" "paige-unpublished" }}
|
|
{{ end }}
|
|
|
|
{{ if $expired }}
|
|
{{ $flags = $flags | append "paige-expired" "paige-unpublished" }}
|
|
{{ end }}
|
|
|
|
{{ if $future }}
|
|
{{ $flags = $flags | append "paige-future" "paige-unpublished" }}
|
|
{{ end }}
|
|
|
|
{{ if $modified }}
|
|
{{ $flags = $flags | append "paige-modified" }}
|
|
{{ end }}
|
|
|
|
{{ $flags = delimit ($flags | sort | uniq) " " }}
|
|
{{ $sectionclass = delimit (split $sectionclass " " | append $flags | sort | uniq) " " }}
|
|
|
|
<section {{ with $sectionclass }} class="{{ . }}" {{ end }}>
|
|
{{ with $title }}
|
|
<p {{ with $titleclass }} class="{{ . }}" {{ end }}><a href="{{ $titlelink }}">{{ . }}</a></p>
|
|
{{ end }}
|
|
|
|
{{ with $description }}
|
|
<p {{ with $descriptionclass }} class="{{ . }}" {{ end }}>{{ . }}</p>
|
|
{{ end }}
|
|
|
|
{{ with $summary }}
|
|
<p {{ with $summaryclass }} class="{{ . }}" {{ end }}>{{ . }}</p>
|
|
{{ end }}
|
|
|
|
{{ if or $categories $tags }}
|
|
<p {{ with $termsouterclass }} class="{{ . }}" {{ end }}>
|
|
{{ $terms := slice }}
|
|
|
|
{{ range $categories }}
|
|
{{ $terms = $terms | append (dict "name" . "url" (lower . | printf "categories/%v/" | relLangURL)) }}
|
|
{{ end }}
|
|
|
|
{{ range $tags }}
|
|
{{ $terms = $terms | append (dict "name" . "url" (lower . | printf "tags/%v/" | relLangURL)) }}
|
|
{{ end }}
|
|
|
|
{{ range sort $terms "name" }}
|
|
<a {{ with $termsinnerclass }} class="{{ . }}" {{ end }} href="{{ .url | safeURL }}">{{ .name }}</a>
|
|
{{ end }}
|
|
</p>
|
|
{{ end }}
|
|
|
|
{{ with $authors }}
|
|
<p {{ with $authorsclass }} class="{{ . }}" {{ end }}>{{ . }}</p>
|
|
{{ end }}
|
|
|
|
{{ with $date }}
|
|
<p {{ with $dateclass }} class="{{ . }}" {{ end }}>
|
|
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat . }}</time>
|
|
</p>
|
|
{{ end }}
|
|
|
|
{{ with $readingtime }}
|
|
<p {{ with $readingtimeclass }} class="{{ . }}" {{ end }}>{{ . }} {{ i18n "paige_minutes" . }}</p>
|
|
{{ end }}
|
|
</section>
|
|
{{ end }}
|
|
{{ end }}
|
|
</section>
|
|
{{ if or $p.HasPrev $p.HasNext }}
|
|
<section>
|
|
<div class="d-flex justify-content-center">
|
|
{{ partial "paige/pagination.html" $page }}
|
|
</div>
|
|
</section>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|