from /tags to tiles

This commit is contained in:
2022-02-23 08:37:00 +01:00
parent 7af2e7ca00
commit 4f6f9af264
18 changed files with 73 additions and 76 deletions
+14 -12
View File
@@ -1,24 +1,26 @@
{{ define "main" }}
{{ $tag := .Name }}
{{ $tile := . }}
{{ $title := .Name }}
{{ range where .Site.RegularPages "Type" "tiles" }}
{{ if eq .Params.CorrespondingTagName $tag }}
{{ $tile = . }}
{{ $title = .Title }}
{{ end }}
{{ end }}
<div class="post">
<div class="post-meta">
<div class="post-content">
{{ if .Description }}
{{ .Description | markdownify }}
{{ end }}
<h1 class="post-subtitle">{{ .Title | markdownify }}</h1>
<h1 class="post-subtitle">{{ $title | markdownify }}</h1>
</div>
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ if $tile }}
{{ partial "tag-cover.html" $tile }}
{{ end }}
{{ partial "tag-cover.html" . }}
<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" }}