Taxonomy add hero image

This commit is contained in:
Nuno Coração 2022-12-12 22:58:42 +00:00
parent 6fd8de1edc
commit 07055a2934
4 changed files with 18 additions and 8 deletions

View file

@ -15,6 +15,8 @@ enableCodeCopy = true
# mainSections = ["section1", "section2"]
# robots = ""
#defaultBackgroundImage = "IMAGE.jpg" # used as default for background images
[header]
layout = "basic" # valid options: basic, fixed
@ -85,8 +87,6 @@ enableCodeCopy = true
showTermCount = true
#showHero = true
#heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
#layoutBackgroundBlur = true # only used when heroStyle equals background
#layoutBackgroundHeaderSpace = false
showBreadcrumbs = false
#showViews = false
#showLikes = false
@ -96,8 +96,6 @@ enableCodeCopy = true
[term]
#showHero = true
#heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
#layoutBackgroundBlur = true # only used when heroStyle equals background
#layoutBackgroundHeaderSpace = false
#showViews = false
#showLikes = false
#showTableOfContents = true

View file

@ -15,6 +15,8 @@ enableCodeCopy = true
mainSections = ["docs"]
# robots = ""
defaultBackgroundImage = "/img/iceland.jpg"
[header]
layout = "fixed" # valid options: basic, fixed
@ -84,8 +86,6 @@ mainSections = ["docs"]
showTermCount = true
showHero = true
heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
layoutBackgroundBlur = true # only used when heroStyle equals background
layoutBackgroundHeaderSpace = false
showBreadcrumbs = false
showViews = true
showLikes = true
@ -95,8 +95,6 @@ mainSections = ["docs"]
[term]
showHero = true
heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
layoutBackgroundBlur = true # only used when heroStyle equals background
layoutBackgroundHeaderSpace = false
showSummary = false
showViews = true
showLikes = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 KiB

View file

@ -1,4 +1,18 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ if .Site.Params.taxonomy.showHero | default false }}
{{ $heroStyle := print "partials/hero/" .Site.Params.taxonomy.heroStyle ".html" }}
{{ if templates.Exists $heroStyle }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "partials/hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.taxonomy.showTableOfContents | default false)) (in
.TableOfContents "<ul") }}
<header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.taxonomy.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}