Restruction

This commit is contained in:
2022-02-20 20:00:01 +01:00
parent 3491caf100
commit 10d0349955
22 changed files with 281 additions and 102 deletions
+51 -61
View File
@@ -7,73 +7,63 @@
{{ $PageContext := . }}
{{ if .IsHome }}
{{ $PageContext = .Site }}
<div class="flex-container">
{{ range (where $PageContext.RegularPages "Type" "tiles") }}
{{ range where $PageContext.Site.RegularPages "Type" "tiles" }}
{{ $count := partial "func/count_posts.html" ( dict "context" . "term" .Params.CorrespondingTagName ) }}
<div class="flex-item-left">
{{ partial "tiles-cover.html" . }}
<figure >
{{if .Params.Cover }}
<!-- Cover image found -- found in tiles -->
<a href="https://{{ .Params.urlLink }}">
<img src="{{ .Params.Cover }}"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" /></a>
{{ else }}
<!-- No cover image found -->
<a href="https://{{ .Params.urlLink }}">
{{ .Title | plainify | default " " }} </a>
{{ end }}
{{ if gt $count 0 }}
<figcaption class="transparentbackgroud post-meta">
<a href="tags/{{ .Params.CorrespondingTagName }}">
#{{ .Params.CorrespondingTagName | plainify }} <small>({{ $count }})</small> </a>
</figcaption >
{{ end }}
</figure>
</div>
{{ end }}
{{ end }}
</div>
<div>
{{ range $.Site.Taxonomies.tags.ByCount }}
{{ $tag_name := .Name }}
{{ $has_tile := "false" }}
{{ range where $.Site.RegularPages "Type" "tiles" }}
{{ if eq .Params.correspondingTagName $tag_name }}
{{ $has_tile = "true" }}
{{ end }}
{{ end }}
{{ if eq $has_tile "false" }}
<span class=" post-meta">
<a href="/tags/{{ .Name }}"> #{{ .Name }} <small>({{ .Count }})</small></a>
</span>
<span>&nbsp;</span>
{{end}}
{{end}}
</div>
{{ end }}
<div class="posts">
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
{{ $PageContext := . }}
{{ if .IsHome }}
{{ $PageContext = .Site }}
{{ end }}
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
{{ range $paginator.Pages }}
<div class="post on-list">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
<div class="post-meta">
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
</span>
{{ with .Params.Author }}
<span class="post-author">:: {{ . }}</span>
{{ end }}
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
{{- . -}}
</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ partial "cover.html" . }}
<div class="post-content">
{{ if .Params.showFullContent }}
{{ .Content }}
{{ else if .Description }}
{{ .Description | markdownify }}
{{ else }}
{{ .Summary | markdownify }}
{{ end }}
</div>
{{ if not .Params.showFullContent }}
<div>
<a class="read-more button"
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
{{ end }}
</div>
{{ end }}
{{ partial "pagination.html" . }}
</div>
{{ end }}