From 141fc9c42c57ee2c1090094680829d2113de2839 Mon Sep 17 00:00:00 2001 From: Naej Doree <0mindstorming@gmail.com> Date: Wed, 8 Jul 2020 00:23:48 +0200 Subject: [PATCH] progressed on mosaic layout --- themes/naej-ananke/layouts/_default/list.html | 4 +- .../naej-ananke/layouts/_default/single.html | 5 ++- .../layouts/_default/taxonomy.html | 7 +-- themes/naej-ananke/layouts/index.html | 43 ++++++++++++++----- themes/naej-ananke/layouts/page/single.html | 5 ++- .../layouts/partials/summary-with-image.html | 6 +-- .../naej-ananke/layouts/partials/summary.html | 4 +- themes/naej-ananke/layouts/post/list.html | 4 +- .../layouts/post/summary-with-image.html | 8 ++-- themes/naej-ananke/layouts/post/summary.html | 33 ++++++++------ 10 files changed, 81 insertions(+), 38 deletions(-) diff --git a/themes/naej-ananke/layouts/_default/list.html b/themes/naej-ananke/layouts/_default/list.html index 130a357..ee8d9c1 100644 --- a/themes/naej-ananke/layouts/_default/list.html +++ b/themes/naej-ananke/layouts/_default/list.html @@ -5,8 +5,8 @@
{{ range .Paginator.Pages }} -
- {{- partial "summary.html" . -}} +
+ {{ .Render "summary" }}
{{ end }}
diff --git a/themes/naej-ananke/layouts/_default/single.html b/themes/naej-ananke/layouts/_default/single.html index 266b97c..8696a52 100644 --- a/themes/naej-ananke/layouts/_default/single.html +++ b/themes/naej-ananke/layouts/_default/single.html @@ -1,8 +1,11 @@ + +{{/* used to show posts */}} + + {{ define "header" }} {{/* We can override any block in the baseof file be defining it in the template */}} {{ partial "page-header.html" . }} {{ end }} -{{/* used to show posts */}} {{ define "main" }} {{ $section := .Site.GetPage "section" .Section }}
diff --git a/themes/naej-ananke/layouts/_default/taxonomy.html b/themes/naej-ananke/layouts/_default/taxonomy.html index 1dc0ff2..c0de4a0 100644 --- a/themes/naej-ananke/layouts/_default/taxonomy.html +++ b/themes/naej-ananke/layouts/_default/taxonomy.html @@ -4,11 +4,12 @@

{{i18n "taxonomyPageList" .}}

-
+
+ {{/* List of articles with the tag */}} {{ range .Pages }} -
- {{ partial "summary.html" . }} +
+ {{ .Render "summary" }}
{{ end }}
diff --git a/themes/naej-ananke/layouts/index.html b/themes/naej-ananke/layouts/index.html index 148525e..6c778e3 100644 --- a/themes/naej-ananke/layouts/index.html +++ b/themes/naej-ananke/layouts/index.html @@ -1,5 +1,7 @@ +{{/*the homepage */}} + {{ define "main" }} -
+
{{ .Content }}
{{/* Define a section to pull recent posts from. For Hugo 0.20 this will default to the section with the most number of pages. */}} @@ -12,44 +14,65 @@ {{/* Derive the section name */}} {{ $section_name := index (.Site.Params.mainSections) 0 }} -
+
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}} {{ with .Site.GetPage "section" $section_name }} -

+

{{ $.Param "recent_copy" | default (i18n "recentTitle" .) }}

{{ end }} - {{ $n_posts := $.Param "recent_posts_number" | default 3 }} + {{/* $n_posts := $.Param "recent_posts_number" | default 3 */}} -
+{{/*list of the projects*/}} +
{{/* Range through the first $n_posts items of the section */}} - {{ range (first $n_posts $section) }} -
- {{ partial "summary-with-image.html" . }} + {{/* range (first $n_posts $section) */}} + {{ range $section }} +
+ {{ .Render "summary" }}
{{ end }}
+ +{{/* + used to display the more content part in the orginal layout + {{ if ge $section_count (add $n_posts 1) }} +
+

{{ i18n "more" }}

- {{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}} + + {{ range (first 4 (after $n_posts $section)) }} +

+ + {{ .Title }} + +

+ {{ end }} - {{/* As above, Use $section_name to get the section title, and URL. Use "with" to only show it if it exists */}} {{ with .Site.GetPage "section" $section_name }} + {{ i18n "allTitle" . }} + {{ end }} +
+ {{ end }} +*/}} + +
{{ end }} {{ end }} diff --git a/themes/naej-ananke/layouts/page/single.html b/themes/naej-ananke/layouts/page/single.html index ac9d199..a22e920 100644 --- a/themes/naej-ananke/layouts/page/single.html +++ b/themes/naej-ananke/layouts/page/single.html @@ -1,16 +1,17 @@ {{ define "header" }}{{ partial "page-header.html" . }}{{ end }} {{ define "main" }} +{{/*used in the contact page*/}}

{{ humanize .Section | upper }}

-

+

{{ .Title }}

-
diff --git a/themes/naej-ananke/layouts/partials/summary-with-image.html b/themes/naej-ananke/layouts/partials/summary-with-image.html index 432bdda..cce67b8 100644 --- a/themes/naej-ananke/layouts/partials/summary-with-image.html +++ b/themes/naej-ananke/layouts/partials/summary-with-image.html @@ -1,8 +1,8 @@ -{{/* used in the "recent project" part */}} +{{/*was used in the "recent project" part, not used anymore */}} {{ $featured_image := partial "func/GetFeaturedImage.html" . }}
-
+
{{ if $featured_image }} {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} @@ -22,7 +22,7 @@ - {{ $.Param "read_more_copy" | default (i18n "readMore") }} + {{ $.Param "read_more_copy" | default (i18n "readMore") }}
diff --git a/themes/naej-ananke/layouts/partials/summary.html b/themes/naej-ananke/layouts/partials/summary.html index 65b3eaa..ca610e9 100644 --- a/themes/naej-ananke/layouts/partials/summary.html +++ b/themes/naej-ananke/layouts/partials/summary.html @@ -1,3 +1,5 @@ +{{/* used for posts in taxonomy - not anymore */}} +
{{ humanize .Section }} @@ -7,7 +9,7 @@
diff --git a/themes/naej-ananke/layouts/post/list.html b/themes/naej-ananke/layouts/post/list.html index 73c9b5c..71baccd 100644 --- a/themes/naej-ananke/layouts/post/list.html +++ b/themes/naej-ananke/layouts/post/list.html @@ -2,13 +2,15 @@ {{/* This template is the same as the default and is here to demonstrate that if you have a content directory called "post" you can create a layouts directory, just for that section. */}} + + {{/* used for the "project" page*/}}
{{ .Content }}