From 99d4fe2ec7164e60f3b737e0758d862feefdeb67 Mon Sep 17 00:00:00 2001 From: Curtis Timson Date: Fri, 16 Feb 2018 22:30:22 +0000 Subject: :sparkles: Hide portfolio section on home if no items --- layouts/index.html | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 8c247a4..02931b3 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -28,13 +28,14 @@
+ {{ $portfolioItems := where .Site.Pages "Type" "portfolio" }} + {{ if $portfolioItems }}
- {{ partial "portfolio.html" . }} -
+ {{ end }} {{ $blogPaginator := .Paginate (where .Data.Pages "Type" .Site.Params.Blog.foldername) 2 }} {{ if $blogPaginator.TotalNumberOfElements }}
diff --git a/package.json b/package.json index 008224d..ccfd571 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hugo-theme-dopetrope", - "version": "2.1.0", + "version": "2.2.0", "description": "Hugo Theme Dopetrope", "main": "index.js", "scripts": { -- cgit v1.2.3 From abc6fe12d177ebf65f247b074eb56b37119b15d3 Mon Sep 17 00:00:00 2001 From: Curtis Timson Date: Fri, 16 Feb 2018 22:35:10 +0000 Subject: :wrench: Configure portfolio folder name --- exampleSite/config-prod.toml | 3 +++ exampleSite/config.toml | 3 +++ layouts/index.html | 2 +- layouts/partials/portfolio.html | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/exampleSite/config-prod.toml b/exampleSite/config-prod.toml index 3a922bf..7cb2739 100644 --- a/exampleSite/config-prod.toml +++ b/exampleSite/config-prod.toml @@ -39,6 +39,9 @@ theme = "../.." title5 = "Vitae tempor lorem" +[params.portfolio] + foldername = "portfolio" + [params.blog] title = "The Blog" viewalltext = "View All" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b54447a..aac2541 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -39,6 +39,9 @@ theme = "../.." title5 = "Vitae tempor lorem" +[params.portfolio] + foldername = "portfolio" + [params.blog] title = "The Blog" viewalltext = "View All" diff --git a/layouts/index.html b/layouts/index.html index 02931b3..82154f2 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -28,7 +28,7 @@
- {{ $portfolioItems := where .Site.Pages "Type" "portfolio" }} + {{ $portfolioItems := where .Site.Pages "Type" .Site.Params.Portfolio.foldername }} {{ if $portfolioItems }}
diff --git a/layouts/partials/portfolio.html b/layouts/partials/portfolio.html index 5a2a605..8fc6c2c 100644 --- a/layouts/partials/portfolio.html +++ b/layouts/partials/portfolio.html @@ -4,7 +4,7 @@

My Portfolio

- {{ range where .Data.Pages "Type" "portfolio" }} + {{ range where .Data.Pages "Type" .Site.Params.Portfolio.foldername }}
-- cgit v1.2.3 From b2ff8e1baf5e6fb86b798dc2232e2d9f3a28bc34 Mon Sep 17 00:00:00 2001 From: Curtis Timson Date: Fri, 16 Feb 2018 22:37:38 +0000 Subject: :sparkles: Hide Portfolio link in header when no posts --- layouts/partials/nav.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index bb524a7..9c901c5 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -2,9 +2,12 @@