From b350c26d3eacd909bedb018c10b656ac3994bc35 Mon Sep 17 00:00:00 2001 From: teldra Date: Sun, 10 Apr 2022 10:35:48 +0200 Subject: [PATCH] small fixes --- themes/buha/layouts/_default/single.html | 2 +- themes/buha/layouts/index.html | 2 +- .../partials/layout/single/article.html | 37 +++++++++---------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/themes/buha/layouts/_default/single.html b/themes/buha/layouts/_default/single.html index ca72b71c..5fb67b2d 100644 --- a/themes/buha/layouts/_default/single.html +++ b/themes/buha/layouts/_default/single.html @@ -13,6 +13,6 @@ {{ $partial = "layout/single/nottranslated" }} {{ end }}
- {{ partial $partial (dict "context" . "pic" $pic "content" .Content "partial_before" $partial_before) }} + {{ partial $partial (dict "context" . "pic" $pic "content" .Content "partial_before" $partial_before "type" "article") }}
{{ end }} diff --git a/themes/buha/layouts/index.html b/themes/buha/layouts/index.html index 997dbb94..92bc4007 100644 --- a/themes/buha/layouts/index.html +++ b/themes/buha/layouts/index.html @@ -16,7 +16,7 @@ {{ partial "l1/article_list" (dict "context" . "pages" $featured "amount" "3" "title" "Featured") }} {{ end }} {{ if gt (len $posts) 1 }} - {{ partial "l1/article_list" (dict "context" . "paginator" $paginator "amount" "5" "title" "News") }} + {{ partial "l1/article_list" (dict "context" . "paginator" $paginator "amount" "5" "title" "News" "type" "list") }}
{{ partial "snippets/paginator" (dict "paginator" $paginator) }}
diff --git a/themes/buha/layouts/partials/layout/single/article.html b/themes/buha/layouts/partials/layout/single/article.html index 839ab515..79ba38ab 100644 --- a/themes/buha/layouts/partials/layout/single/article.html +++ b/themes/buha/layouts/partials/layout/single/article.html @@ -1,14 +1,11 @@ {{ $metas := dict "when" .context.Params.when "price" .context.Params.price "contact" .context.Params.contact "covid" .context.Params.covid }} -{{ if eq .type "list" }} +{{ if eq .context.Type "list" }} {{ $metas = dict "when" .context.Params.when "price" .context.Params.price }} {{ end }} {{ $small := "solo" }} {{ $big := "solo" }} -{{ $img := "" }} -{{ $thumb := "" }} -{{ $placeholder := site.Params.placeholder }} {{- if or (.context.Resources.ByType "image") (.context.Summary) -}} {{ $small = "multiple_small" }} @@ -17,25 +14,25 @@ {{ $small = "multiple_big"}} {{ end }} -{{- if .context.Resources.ByType "image" -}} - {{- $img = index (.context.Resources.ByType "image") 0 -}} - {{ if ne .context.Content "" }} - {{- $thumb = $img.Resize "2048x" }} - {{ else if .type "list" }} - {{- $thumb = $img.Resize "500x" }} - {{ end }} -{{ end }} + {{ partial "snippets/article_metadata" $metas }}
- {{ if and (ne $img "") (eq .pic "true")}} -
- {{ if and (ne .type "list") (.context.Resources.ByType "image") }}{{ end }} - - {{ if ne .type "list" }}{{ end }} - {{ if eq .type "article" }}{{ end }} -
- {{ end }} +{{- if and (.context.Resources.ByType "image") (eq .pic "true") -}} + {{- $img := index (.context.Resources.ByType "image") 0 -}} + {{- $thumb := index (.context.Resources.ByType "image") 0 -}} + {{ if ne .context.Content "" }} + {{- $thumb = $img.Resize "2048x" }} + {{ else if eq .type "list" }} + {{- $thumb = $img.Resize "500x" }} + {{ end }} +
+ {{ if and (ne .type "list") (.context.Resources.ByType "image") }}{{ end }} + + {{ if ne .type "list" }}{{ end }} + {{ if eq .type "article" }}{{ end }} +
+{{ end }} {{- if or .context.Content .context.Summary -}}
{{ if eq .type "contact" }}{{ partial "structure/contact" }}{{ end }}