135 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			135 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| {{ $params := . }}
 | |
| 
 | |
| {{ $item := $params.item }}
 | |
| {{ $list := $params.list }}
 | |
| 
 | |
| {{ $authors := partial "paige/func-authors.html" $item | and ($list.Param "paige.subpages.disable_authors" | not) }}
 | |
| {{ $categories := $item.GetTerms "categories" }}
 | |
| {{ $date := $item.PublishDate | and ($list.Param "paige.subpages.disable_date" | not) }}
 | |
| {{ $description := $item.Description | markdownify | plainify | htmlUnescape | and ($list.Param "paige.subpages.disable_description" | not) }}
 | |
| {{ $draft := $item.Draft }}
 | |
| {{ $expired := and $item.ExpiryDate (lt $item.ExpiryDate now) }}
 | |
| {{ $flags := slice }}
 | |
| {{ $format := $list.Param "paige.site.date_format" | default ":date_long" }}
 | |
| {{ $future := and $item.PublishDate (gt $item.PublishDate now) }}
 | |
| {{ $link := $item.RelPermalink }}
 | |
| {{ $modified := and $item.PublishDate $item.Lastmod (lt $item.PublishDate $item.Lastmod) }}
 | |
| {{ $normal := eq ($list.Param "paige.site.keyword_style" | default "text") "text" }}
 | |
| {{ $series := $item.GetTerms "series" | and ($list.Param "paige.subpages.disable_series" | not) }}
 | |
| {{ $summary := $item.Summary | markdownify | plainify | htmlUnescape | and ($list.Param "paige.subpages.disable_summary" | not) }}
 | |
| {{ $tags := $item.GetTerms "tags" }}
 | |
| {{ $time := $item.ReadingTime | and ($list.Param "paige.subpages.disable_reading_time" | not) }}
 | |
| {{ $title := $item.LinkTitle | markdownify | plainify | htmlUnescape | and ($list.Param "paige.subpages.disable_title" | not) }}
 | |
| {{ $words := $item.WordCount | and ($list.Param "paige.subpages.disable_word_count" | not) }}
 | |
| 
 | |
| {{ if $draft }}
 | |
|     {{ $flags = $flags | append "paige-status-draft" "paige-status-unpublished" }}
 | |
| {{ end }}
 | |
| 
 | |
| {{ if $expired }}
 | |
|     {{ $flags = $flags | append "paige-status-expired" "paige-status-unpublished" }}
 | |
| {{ end }}
 | |
| 
 | |
| {{ if $future }}
 | |
|     {{ $flags = $flags | append "paige-status-future" "paige-status-unpublished" }}
 | |
| {{ end }}
 | |
| 
 | |
| {{ if $modified }}
 | |
|     {{ $flags = $flags | append "paige-status-modified" }}
 | |
| {{ end }}
 | |
| 
 | |
| {{ if not (or $draft $expired $future) }}
 | |
|     {{ $flags = $flags | append "paige-status-published" }}
 | |
| {{ end }}
 | |
| 
 | |
| {{ $class := delimit (slice "paige-page" "text-center" "w-100" | append $flags | uniq | sort) " " }}
 | |
| {{ $keywords := sort (append $categories $tags) "LinkTitle" | and ($list.Param "paige.subpages.disable_keywords" | not) }}
 | |
| 
 | |
| <div class="{{ $class }}">
 | |
|     {{ with $title }}
 | |
|         <p class="paige-page-title paige-row-short"><a href="{{ $link }}">{{ . }}</a></p>
 | |
|     {{ end }}
 | |
| 
 | |
|     {{ with $description }}
 | |
|         <p class="paige-page-description paige-row-short">{{ . }}</p>
 | |
|     {{ end }}
 | |
| 
 | |
|     {{ with $summary }}
 | |
|         <p class="fst-italic paige-page-summary paige-row-short">{{ . }}</p>
 | |
|     {{ end }}
 | |
| 
 | |
|     {{ with $keywords }}
 | |
|         <p class="paige-page-keywords paige-row-short text-secondary">
 | |
|             {{ range $i, $term := . }}
 | |
|                 {{ $kind := false }}
 | |
| 
 | |
|                 {{ if in $categories $term }}
 | |
|                     {{ $kind = "category" }}
 | |
|                 {{ else }}
 | |
|                     {{ $kind = "tag" }}
 | |
|                 {{ end }}
 | |
| 
 | |
|                 {{ if $normal }}
 | |
|                     {{ if gt $i 0 }} · {{ end }}
 | |
| 
 | |
|                     {{ if .RelPermalink }}
 | |
|                         <a class="link-secondary paige-page-keyword-{{ $kind }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
 | |
|                     {{ else }}
 | |
|                         <span class="paige-page-keyword-{{ $kind }}">{{ .LinkTitle }}</span>
 | |
|                     {{ end }}
 | |
|                 {{ else }}
 | |
|                     {{ if gt $i 0 }} {{ end }}
 | |
| 
 | |
|                     {{ if .RelPermalink }}
 | |
|                         <a class="badge paige-page-keyword-{{ $kind }} text-bg-secondary text-decoration-none" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
 | |
|                     {{ else }}
 | |
|                         <span class="badge paige-page-keyword-{{ $kind }} text-bg-secondary">{{ .LinkTitle }}</span>
 | |
|                     {{ end }}
 | |
|                 {{ end }}
 | |
|             {{ end }}
 | |
|         </p>
 | |
|     {{ end }}
 | |
| 
 | |
|     {{ with $series }}
 | |
|         <p class="paige-page-series paige-row-short text-secondary">
 | |
|             {{ range $i, $series := . }}
 | |
|                 {{ if gt $i 0 }} · {{ end }}
 | |
| 
 | |
|                 {{ if .RelPermalink }}
 | |
|                     <a class="link-secondary" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
 | |
|                 {{ else }}
 | |
|                     <span class="text-secondary">{{ .LinkTitle }}</span>
 | |
|                 {{ end }}
 | |
|             {{ end }}
 | |
|         </p>
 | |
|     {{ end }}
 | |
| 
 | |
|     {{ with $authors }}
 | |
|         <p class="paige-page-authors paige-row-short text-secondary">
 | |
|             {{ range $i, $author := . }}
 | |
|                 {{ if gt $i 0 }} · {{ end }}
 | |
| 
 | |
|                 {{ if .RelPermalink }}
 | |
|                     <a class="link-secondary" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
 | |
|                 {{ else }}
 | |
|                     <span class="text-secondary">{{ .LinkTitle }}</span>
 | |
|                 {{ end }}
 | |
|             {{ end }}
 | |
|         </p>
 | |
|     {{ end }}
 | |
| 
 | |
|     {{ with $date }}
 | |
|         <p class="paige-page-date paige-row-short text-secondary">
 | |
|             <time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $format . }}</time>
 | |
|         </p>
 | |
|     {{ end }}
 | |
| 
 | |
|     {{ with $words }}
 | |
|         <p class="paige-page-word-count paige-row-short text-secondary">{{ . }} {{ i18n "paige_words" . }}</p>
 | |
|     {{ end }}
 | |
| 
 | |
|     {{ with $time }}
 | |
|         <p class="paige-page-reading-time paige-row-short text-secondary">{{ . }} {{ i18n "paige_minutes" . }}</p>
 | |
|     {{ end }}
 | |
| </div>
 |