From 257ada444052e82bb8994f013c758fb5926221c7 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Mon, 19 Jul 2021 20:32:58 +0530 Subject: [PATCH] Fix leaf bundle rendering for singles type --- .../{project.md => projects/_index.md} | 1 - exampleSite/content/projects/tatooine.md | 1 - themes/gokarna/layouts/_default/list.html | 19 +++++-------------- themes/gokarna/layouts/_default/single.html | 6 +++--- themes/gokarna/layouts/partials/head.html | 2 +- themes/gokarna/layouts/partials/list.html | 14 ++++++++++++++ 6 files changed, 23 insertions(+), 20 deletions(-) rename exampleSite/content/{project.md => projects/_index.md} (89%) create mode 100644 themes/gokarna/layouts/partials/list.html diff --git a/exampleSite/content/project.md b/exampleSite/content/projects/_index.md similarity index 89% rename from exampleSite/content/project.md rename to exampleSite/content/projects/_index.md index 6bb24e2..a61b7bb 100644 --- a/exampleSite/content/project.md +++ b/exampleSite/content/projects/_index.md @@ -1,7 +1,6 @@ --- title: "Projects" type: singles -slug: /projects --- diff --git a/exampleSite/content/projects/tatooine.md b/exampleSite/content/projects/tatooine.md index e6e79a7..7deb229 100644 --- a/exampleSite/content/projects/tatooine.md +++ b/exampleSite/content/projects/tatooine.md @@ -2,7 +2,6 @@ title: "Tatooine" date: 2021-05-12T23:39:49+05:30 type: singles -slug: tatooine --- ### A long time ago in a galaxy far, far away.... diff --git a/themes/gokarna/layouts/_default/list.html b/themes/gokarna/layouts/_default/list.html index e033694..437033d 100644 --- a/themes/gokarna/layouts/_default/list.html +++ b/themes/gokarna/layouts/_default/list.html @@ -1,16 +1,7 @@ -{{ define "main" }} -
- -

{{ .Name }}

- - {{ range (where .Site.Pages "Params.type" "post" ).GroupByDate "2006" }} - -

{{ .Key }}

- - {{- range .Pages -}} - {{- partial "list-posts.html" . -}} +{{ define "main" }} + {{ if eq .Type "singles" }} + {{- partial "single.html" . -}} + {{ else }} + {{- partial "list.html" . -}} {{ end }} - {{ end }} - -
{{ end }} diff --git a/themes/gokarna/layouts/_default/single.html b/themes/gokarna/layouts/_default/single.html index d673775..92886e9 100644 --- a/themes/gokarna/layouts/_default/single.html +++ b/themes/gokarna/layouts/_default/single.html @@ -1,9 +1,9 @@ {{ define "main" }} {{ if eq .Type "post" }} - {{- partial "post.html" . -}} + {{- partial "post.html" . -}} {{ end }} {{ if eq .Type "singles" }} - {{- partial "single.html" . -}} + {{- partial "single.html" . -}} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/themes/gokarna/layouts/partials/head.html b/themes/gokarna/layouts/partials/head.html index 4bbf196..77c4d8a 100644 --- a/themes/gokarna/layouts/partials/head.html +++ b/themes/gokarna/layouts/partials/head.html @@ -3,7 +3,7 @@ - + + +

{{ .Name }}

+ + {{ range (where .Site.Pages "Params.type" "post" ).GroupByDate "2006" }} + +

{{ .Key }}

+ + {{- range .Pages -}} + {{- partial "list-posts.html" . -}} + {{ end }} + {{ end }} + +