Merge pull request #320 from nunocoracao/309-term-add-hero-image

✨Term add hero image
This commit is contained in:
Nuno Coração authored and GitHub committed 2022-12-12 23:17:52 +00:00
commit 5d5dcaa7f8
7 files changed
+21 -5

No files matched your search

+1
View File
@@ -96,6 +96,7 @@ enableCodeCopy = true
[term]
#showHero = true
#heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
showBreadcrumbs = false
#showSummary = false
#showViews = false
#showLikes = false
+1
View File
@@ -95,6 +95,7 @@ defaultBackgroundImage = "/img/iceland.jpg"
[term]
showHero = true
heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
showBreadcrumbs = false
showSummary = false
showViews = true
showLikes = true
+1 -1
View File
@@ -1,5 +1,5 @@
---
title: advanced
title: Advanced
---
This is the advanced tag. Just like other listing pages in Blowfish, you can add custom content to individual taxonomy terms and it will be displayed at the top of the term listing. :rocket:
+1 -1
View File
@@ -17,7 +17,7 @@
{{ if .Params.showBreadcrumbs | default (.Site.Params.taxonomy.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta-taxonomy.html" (dict "context" . "scope" "single") }}
</div>
+16 -2
View File
@@ -1,9 +1,23 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ if .Site.Params.term.showHero | default false }}
{{ $heroStyle := print "partials/hero/" .Site.Params.term.heroStyle ".html" }}
{{ if templates.Exists $heroStyle }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "partials/hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.term.showTableOfContents | default false)) (in
.TableOfContents "<ul") }}
<header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.term.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta-term.html" (dict "context" . "scope" "single") }}
</div>
+1 -1
View File
@@ -1,6 +1,6 @@
{{ $articleClasses := "flex flex-wrap article" }}
{{ if .Site.Params.list.showCards }}
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md") " " }}
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md backdrop-blur") " " }}
{{ else }}
{{ $articleClasses = delimit (slice $articleClasses "") " " }}
{{ end }}