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

Term add hero image
This commit is contained in:
Nuno Coração 2022-12-12 23:17:52 +00:00 committed by GitHub
commit 5d5dcaa7f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 5 deletions

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

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

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:

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>

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>

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 }}