From a83b1c5658c5bcb3f82a794b249cda8bd58e1550 Mon Sep 17 00:00:00 2001 From: Jason Tipton Date: Fri, 3 Jul 2020 11:04:30 -0800 Subject: [PATCH] Allow section titles to be hidden inline (#24) * Allow section titles to be hidden within the section themselves * Show sections in footer to match navbar --- exampleSite/data/sections/achievements.yaml | 2 ++ exampleSite/data/sections/experiences.yaml | 3 ++- exampleSite/data/sections/projects.yaml | 2 ++ exampleSite/data/sections/recent-posts.yaml | 2 ++ exampleSite/data/sections/skills.yaml | 2 ++ layouts/partials/achievements.html | 4 +++- layouts/partials/experiences.html | 4 +++- layouts/partials/footer.html | 2 +- layouts/partials/navbar.html | 2 +- layouts/partials/projects.html | 4 +++- layouts/partials/recent-posts.html | 4 +++- layouts/partials/skills.html | 4 +++- 12 files changed, 27 insertions(+), 8 deletions(-) diff --git a/exampleSite/data/sections/achievements.yaml b/exampleSite/data/sections/achievements.yaml index 5877753..eee213b 100644 --- a/exampleSite/data/sections/achievements.yaml +++ b/exampleSite/data/sections/achievements.yaml @@ -4,6 +4,8 @@ section: enable: true weight: 6 showOnNavbar: true + # Can optionally hide the title in sections + # hideTitle: true # Your achievements achievements achievements: diff --git a/exampleSite/data/sections/experiences.yaml b/exampleSite/data/sections/experiences.yaml index 3ed8349..b5366d6 100644 --- a/exampleSite/data/sections/experiences.yaml +++ b/exampleSite/data/sections/experiences.yaml @@ -4,7 +4,8 @@ section: enable: true weight: 3 showOnNavbar: true - + # Can optionally hide the title in sections + # hideTitle: true # Your experiences experiences: diff --git a/exampleSite/data/sections/projects.yaml b/exampleSite/data/sections/projects.yaml index 0d84565..ea0c02e 100644 --- a/exampleSite/data/sections/projects.yaml +++ b/exampleSite/data/sections/projects.yaml @@ -4,6 +4,8 @@ section: enable: true weight: 4 showOnNavbar: true + # Can optionally hide the title in sections + # hideTitle: true # filter buttons buttons: diff --git a/exampleSite/data/sections/recent-posts.yaml b/exampleSite/data/sections/recent-posts.yaml index 9fb496a..357e99f 100644 --- a/exampleSite/data/sections/recent-posts.yaml +++ b/exampleSite/data/sections/recent-posts.yaml @@ -4,5 +4,7 @@ section: enable: true weight: 5 showOnNavbar: true + # Can optionally hide the title in sections + # hideTitle: true # no other configuration is required diff --git a/exampleSite/data/sections/skills.yaml b/exampleSite/data/sections/skills.yaml index 05730d8..8a8aaac 100644 --- a/exampleSite/data/sections/skills.yaml +++ b/exampleSite/data/sections/skills.yaml @@ -4,6 +4,8 @@ section: enable: true weight: 2 showOnNavbar: true + # Can optionally hide the title in sections + # hideTitle: true # Your Skills. # Give a summary of you each skill in the summary section. diff --git a/layouts/partials/achievements.html b/layouts/partials/achievements.html index 1805631..75995a9 100644 --- a/layouts/partials/achievements.html +++ b/layouts/partials/achievements.html @@ -1,5 +1,7 @@
-

{{ .section.name }}

+ {{ if not (.section.hideTitle) }} +

{{ .section.name }}

+ {{ end }}
diff --git a/layouts/partials/experiences.html b/layouts/partials/experiences.html index 5c63d14..d63b319 100644 --- a/layouts/partials/experiences.html +++ b/layouts/partials/experiences.html @@ -1,5 +1,7 @@
-

{{ .section.name }}

+ {{ if not (.section.hideTitle) }} +

{{ .section.name }}

+ {{ end }}
{{ $totalExperiences:= len .experiences }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8c8649a..77693ce 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -6,7 +6,7 @@ {{ if .Site.Data.sections }}
    {{- range sort .Site.Data.sections "section.weight" }} - {{ if .section.enable }} + {{ if and (.section.enable) (.section.showOnNavbar)}} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 00570c7..dc1b872 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -21,7 +21,7 @@ {{- if .Site.Data.sections }} {{- range sort .Site.Data.sections "section.weight" }} - {{ if (and .section.enable .section.showOnNavbar) }} + {{ if and (.section.enable) (.section.showOnNavbar)}} diff --git a/layouts/partials/projects.html b/layouts/partials/projects.html index e8a9f35..fc23c72 100644 --- a/layouts/partials/projects.html +++ b/layouts/partials/projects.html @@ -1,5 +1,7 @@
    -

    {{ .section.name }}

    + {{ if not (.section.hideTitle) }} +

    {{ .section.name }}

    + {{ end }}
    {{ range .buttons }} diff --git a/layouts/partials/recent-posts.html b/layouts/partials/recent-posts.html index 03142fc..2d0cc87 100644 --- a/layouts/partials/recent-posts.html +++ b/layouts/partials/recent-posts.html @@ -1,5 +1,7 @@
    -

    {{ .section.name }}

    + {{ if not (.section.hideTitle) }} +

    {{ .section.name }}

    + {{ end }}
    {{ range first 3 (where site.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections )}} diff --git a/layouts/partials/skills.html b/layouts/partials/skills.html index 5fab89a..8790be6 100644 --- a/layouts/partials/skills.html +++ b/layouts/partials/skills.html @@ -1,5 +1,7 @@
    -

    {{ .section.name }}

    + {{ if not (.section.hideTitle) }} +

    {{ .section.name }}

    + {{ end }}
    {{ range .skills }}