From d1415795be5329834cfeca0c95ac8d488005dfb7 Mon Sep 17 00:00:00 2001 From: budparr Date: Mon, 5 Feb 2018 09:28:46 -0500 Subject: [PATCH] Move showcase items in list view to a template in the layout This seems more efficient to me than keeping it in a partial, being that it won't be used elsewhere and will help keep "partial-srprawl" down. --- .../partials/boxes-showcase-items.html | 14 ----------- .../gohugoioTheme/layouts/showcase/list.html | 24 +++++++++++++++++-- 2 files changed, 22 insertions(+), 16 deletions(-) delete mode 100644 themes/gohugoioTheme/layouts/partials/boxes-showcase-items.html diff --git a/themes/gohugoioTheme/layouts/partials/boxes-showcase-items.html b/themes/gohugoioTheme/layouts/partials/boxes-showcase-items.html deleted file mode 100644 index d35bb350a..000000000 --- a/themes/gohugoioTheme/layouts/partials/boxes-showcase-items.html +++ /dev/null @@ -1,14 +0,0 @@ - -
- {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} - {{ with $img }} - {{ $img := .Fill "600x300 top" }} - - {{end}} -
{{/* the margin aligns to the bottom */}} -

- {{- .Title -}} -

-
-
-
diff --git a/themes/gohugoioTheme/layouts/showcase/list.html b/themes/gohugoioTheme/layouts/showcase/list.html index 12a560293..87d019c90 100644 --- a/themes/gohugoioTheme/layouts/showcase/list.html +++ b/themes/gohugoioTheme/layouts/showcase/list.html @@ -9,8 +9,8 @@
- {{ range (.Paginator 20).Pages }} - {{ partial "boxes-showcase-items.html" . }} + {{ range (.Paginator 20).Pages }} + {{template "showcase_items" .}} {{ end }}
{{ end }} + + +{{define "showcase_items"}} + +
+ {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $img := .Fill "600x300 top" }} + + {{end}} +
{{/* the margin aligns to the bottom */}} +

+ {{- .Title -}} +

+
+
+
+ + +{{end}}