From aa10defeddf75114f70b6479671051f3227fbc49 Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Tue, 6 Feb 2018 14:27:15 -0500 Subject: [PATCH] Iterating on Showcase (#330) * Fix issue where some screens made the buttons overlap * Make three across to give an easier overview and promote click-through * Improve template so the layout can be manipulated and * Rearranage order of columns * Fix order so image shows on top on small devices * Add styling to improve nav list * Adjust font to fit in box Because it's a link this line doesn't break, so making the font smaller it stays within the box. * Move title to details box * Remove page header As per BEP. --- ...ious-next-links-in-section-with-title.html | 4 +- .../gohugoioTheme/layouts/showcase/list.html | 4 +- .../layouts/showcase/single.html | 137 ++++++++++-------- 3 files changed, 82 insertions(+), 63 deletions(-) diff --git a/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html b/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html index fa76846b7..71a14c0ef 100644 --- a/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html +++ b/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html @@ -2,11 +2,11 @@ {{/* this div holds these a tags as a unit for flex-box display */}}
{{if .NextInSection}} - {{ partial "svg/ic_chevron_left_black_24px.svg" (dict "fill" "#fff" "size" "12px") }} {{.NextInSection.Title}} + {{ partial "svg/ic_chevron_left_black_24px.svg" (dict "fill" "#fff" "size" "12px") }} {{.NextInSection.Title}} {{end}} {{if .PrevInSection}} - + {{.PrevInSection.Title}} {{ partial "svg/ic_chevron_right_black_24px.svg" (dict "fill" "#fff" "size" "12px") }} {{end}} diff --git a/themes/gohugoioTheme/layouts/showcase/list.html b/themes/gohugoioTheme/layouts/showcase/list.html index 87d019c90..0553e4af1 100644 --- a/themes/gohugoioTheme/layouts/showcase/list.html +++ b/themes/gohugoioTheme/layouts/showcase/list.html @@ -9,7 +9,7 @@
- {{ range (.Paginator 20).Pages }} + {{ range (.Paginator 20).Pages }} {{template "showcase_items" .}} {{ end }}
@@ -22,7 +22,7 @@ {{define "showcase_items"}} - +
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} {{ with $img }} diff --git a/themes/gohugoioTheme/layouts/showcase/single.html b/themes/gohugoioTheme/layouts/showcase/single.html index 2bc4e6b64..583dcfe33 100644 --- a/themes/gohugoioTheme/layouts/showcase/single.html +++ b/themes/gohugoioTheme/layouts/showcase/single.html @@ -1,71 +1,90 @@ {{ define "main" }} - {{$section := where .Site.RegularPages "Section" .Section}} - {{$number_of_entries := $section | len}}
+ -
-

- - {{ .Title }} - -

-
-
-
- +
+ +
+ {{template "details" .}}
-
- {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} - {{ with $img }} - {{ $img := .Resize "940x" }} - {{ $img.Title }} - {{ end }} - {{with .Content}} - - {{end}} + +
+ {{template "main-column" .}}
-
- {{/* bottom row */}} -
+ +
{{/* bottom row */}} Last Update: {{ .Lastmod.Format "January 2, 2006" }}
{{ partial "page-edit.html" . }}
+
{{ end }} + + + +{{define "main-column"}} + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $img := .Resize "940x" }} + {{ $img.Title }} + {{ end }} + {{with .Content}} + + {{end}} +{{end}} + +{{define "details"}} + +{{end}} + +{{define "navigation"}} + {{$section := where .Site.RegularPages "Section" .Section}} + {{$number_of_entries := $section | len}} + +{{end}}