mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-23 06:55:43 -06:00
turned hero into a partial
This commit is contained in:
parent
80425321f3
commit
e9a17706ae
4 changed files with 12 additions and 13 deletions
|
@ -40,4 +40,4 @@ The you just need to add an image like explain earlier. If you want to see a sam
|
||||||
|
|
||||||
## Hero Images
|
## Hero Images
|
||||||
|
|
||||||
Thumbnails will be used by default as hero images withing each article. Use the global `article.showHero` or the front-matter parameter `showHero` to control this feature across the entire site or for each specific post.
|
Thumbnails will be used by default as hero images withing each article. Use the global `article.showHero` or the front-matter parameter `showHero` to control this feature across the entire site or for each specific post. If you want to override the style of the hero image you can create a file called `hero.html` in `./layouts/partials/` that will override the original partial from the theme.
|
Binary file not shown.
After Width: | Height: | Size: 2.6 MiB |
|
@ -1,17 +1,6 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<article>
|
<article>
|
||||||
|
{{ partial "hero.html" . }}
|
||||||
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
|
|
||||||
{{- $images := .Resources.ByType "image" -}}
|
|
||||||
{{- $featured := $images.GetMatch "*feature*" -}}
|
|
||||||
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
|
||||||
{{- with $featured -}}
|
|
||||||
{{ with .Resize "600x" }}
|
|
||||||
<div class="w-full h-36 md:h-56 lg:h-72 single_hero nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
|
||||||
{{ end }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
<header class="mt-5 max-w-prose">
|
<header class="mt-5 max-w-prose">
|
||||||
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
|
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
|
||||||
{{ partial "breadcrumbs.html" . }}
|
{{ partial "breadcrumbs.html" . }}
|
||||||
|
|
10
layouts/partials/hero.html
Normal file
10
layouts/partials/hero.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
|
||||||
|
{{- $images := .Resources.ByType "image" -}}
|
||||||
|
{{- $featured := $images.GetMatch "*feature*" -}}
|
||||||
|
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
||||||
|
{{- with $featured -}}
|
||||||
|
{{ with .Resize "600x" }}
|
||||||
|
<div class="w-full h-36 md:h-56 lg:h-72 single_hero nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
||||||
|
{{ end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
Loading…
Reference in a new issue