From 733bfb46f71d75e0ec20327cbb1bfd77b4029f3e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 24 Apr 2017 09:06:14 +0100 Subject: [PATCH] Extract box to partial --- layouts/_default/list.html | 13 +------------ layouts/index.html | 23 +++++++++++++---------- layouts/partials/box.html | 12 ++++++++++++ 3 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 layouts/partials/box.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f22d53f..4006aba 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -11,18 +11,7 @@ {{ end }}
{{ range .Pages.ByTitle }} -
-
- {{ if .Params.image }} - {{ .Title }} featured image - {{ end }} -

{{ title .Title }}

-

{{ .Summary }}

- -
-
+ {{ partial "box.html" . }} {{ end }}
diff --git a/layouts/index.html b/layouts/index.html index 78c1cdf..3d97023 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -40,21 +40,24 @@ +
+

Projects

+
+ {{ range first 6 (where .Data.Pages.ByDate "Kind" "projects") }} + {{ if ne .Section "" }} + {{ partial "box.html" . }} + {{ end }} + {{ end }} +
+

All Projects

+
+

Recent Posts

{{ range first 6 (where .Data.Pages.ByDate "Kind" "page") }} {{ if ne .Section "" }} -
-
- -

{{ .Title }}

-

{{ .Summary }}

- -
-
+ {{ partial "box.html" . }} {{ end }} {{ end }}
diff --git a/layouts/partials/box.html b/layouts/partials/box.html new file mode 100644 index 0000000..184cab3 --- /dev/null +++ b/layouts/partials/box.html @@ -0,0 +1,12 @@ +
+
+ {{ if .Params.image }} + {{ .Title }} featured image + {{ end }} +

{{ title .Title }}

+

{{ .Summary }}

+ +
+