From 2dfd95729613ce84d54a3a3ddcfff8b832186213 Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Fri, 14 Apr 2017 21:58:31 -0400 Subject: [PATCH] clean up --- layouts/_default/list.html | 8 +-- layouts/_default/single.html | 19 ++++--- layouts/article/single.html | 14 ++--- layouts/article/summary-with-image.html | 19 +++++++ layouts/article/summary.html | 5 +- layouts/index.html | 69 ++++++++++--------------- layouts/section/article.html | 10 ++-- layouts/shortcodes/form-contact.html | 43 +++++++++++++++ 8 files changed, 117 insertions(+), 70 deletions(-) create mode 100644 layouts/article/summary-with-image.html create mode 100644 layouts/shortcodes/form-contact.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 6ca0963..cf7fdb5 100755 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,14 +1,16 @@ {{ define "main" }}
-
-
+
{{ $section := where .Data.Pages "Section" .Section }}
{{ range $section }} - {{ partial "summary.html" . }} +
+ {{ partial "summary.html" . }} +
{{ end }}
{{ template "_internal/pagination.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index fe90663..9f7d553 100755 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,19 +1,18 @@ {{ define "header" }}{{ partial "page-header.html" . }}{{ end }} {{ define "main" }} - {{ $currentPageUrl := .URL }} -
-
-

+
+
+

{{ humanize .Section | upper }} -

-

+

+

{{ .Title }}

-
- {{ .Content }} -
+
-
+
{{ partial "menu-contextual.html" . }}
diff --git a/layouts/article/single.html b/layouts/article/single.html index cf06681..8e9f3c1 100644 --- a/layouts/article/single.html +++ b/layouts/article/single.html @@ -1,8 +1,8 @@ {{ define "header" }}{{ partial "page-header.html" . }}{{ end }} {{ define "main" }} -
-
-

+

+
+

{{ humanize .Section | upper }}

@@ -10,14 +10,14 @@

{{/* TODO: Add Hugo author */}} -
-
+
{{ partial "menu-contextual.html" . }}
diff --git a/layouts/article/summary-with-image.html b/layouts/article/summary-with-image.html new file mode 100644 index 0000000..2831ae1 --- /dev/null +++ b/layouts/article/summary-with-image.html @@ -0,0 +1,19 @@ + diff --git a/layouts/article/summary.html b/layouts/article/summary.html index b57becd..b51e3ec 100644 --- a/layouts/article/summary.html +++ b/layouts/article/summary.html @@ -1,5 +1,5 @@ -
-
+ +
{{ if .Date }} {{ .Date.Format "January 2, 2006" }} @@ -16,4 +16,3 @@

-
diff --git a/layouts/index.html b/layouts/index.html index d0b326a..d57e3d5 100755 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,53 +1,36 @@ {{ define "main" }} - -
+
{{ .Content }} -
+
+

+ Recent Articles +

-
-

Recent Articles

- -
- {{ $section := where .Data.Pages "Section" "article" }} - -
- {{ range sort (first 1 $section) "Date" "desc" }} - {{ if .Date }} - - {{ .Date.Format "January 2, 2006" }} - - {{ end }} -

- - {{ .Title }} - -

- - {{ end }} -
- -
- {{ range sort (first 4 (after 1 $section)) "Date" "desc" }} -

- - {{ .Title }} - -

- {{ end }} -
+ {{/* Create a variable to use the same section twice. Note that we've included the date here. */}} + {{ $section := where .Data.Pages.ByDate.Reverse "Section" "article" }} +
+ {{ range (first 3 $section) }} +
+ {{ .Render "summary-with-image" }} +
+ {{ end }} +
+
+

More posts

+ {{/* Nest the requirements, "after" then "first" on the outside */}} + {{ range (first 4 (after 1 $section)) }} +

+ + {{ .Title }} + +

+ {{ end }} + All Posts +
-
- - - - {{ end }} diff --git a/layouts/section/article.html b/layouts/section/article.html index 09446ee..3acc693 100644 --- a/layouts/section/article.html +++ b/layouts/section/article.html @@ -1,12 +1,14 @@ {{ define "main" }}
-
- {{ .Content }} -
+
+ {{ .Content }} +
{{ $section := .Paginate (where .Data.Pages "Section" .Section) }}
{{ range $section.Pages }} - {{ .Render "summary" }} +
+ {{ .Render "summary" }} +
{{ end }}
{{ template "_internal/pagination.html" . }} diff --git a/layouts/shortcodes/form-contact.html b/layouts/shortcodes/form-contact.html new file mode 100644 index 0000000..b820a16 --- /dev/null +++ b/layouts/shortcodes/form-contact.html @@ -0,0 +1,43 @@ +{{/*
+
+ + + Helper text for the form control. + + + + Helper text for the form control. + + + + Helper text for the form control. +
+
*/}} +{{ $.Scratch.Add "labelClasses" "f6 b db mb1 mt3 sans-serif mid-gray" }} +{{ $.Scratch.Add "inputClasses" "w-100 f5 pv3 ph3 bg-light-gray bn" }} + +
+ + + + + + + + + + + + + +
+ Must be a valid email address. +
+ + + + + + + +