Default featured image

This commit is contained in:
Nuno Coração 2023-04-29 12:08:08 +01:00
parent ca81165e93
commit 53e6a6a45b
8 changed files with 10 additions and 5 deletions

View file

@ -18,6 +18,7 @@ enableCodeCopy = false
disableImageOptimization = false
# defaultBackgroundImage = "IMAGE.jpg" # used as default for background images
# defaultFeaturedImage = "IMAGE.jpg" # used as default for featured images in all articles
# highlightCurrentMenuArea = true
# smartTOC = true

View file

@ -18,6 +18,7 @@ mainSections = ["docs"]
disableImageOptimization = false
defaultBackgroundImage = "/img/bg.jpg"
#defaultFeaturedImage = "/img/blowfish_logo.png"
highlightCurrentMenuArea = true
smartTOC = true

View file

@ -147,14 +147,15 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `disableImageZoom` | `false` | Disables image zoom feature across all the images in the site. |
| `disableImageOptimization` | `false` | Disables image resize and optimization features across all the images in the site. |
| `defaultBackgroundImage` | _Not set_ | Default background image for both `background` homepage layout and `background` hero style |
| `defaultBackgrouclearndImage` | _Not set_ | Marks menu entries in the main manu when selected |
| `defaultFeaturedImage` | _Not set_ | Default background image for all `featured` images across articles, will be overriden by a local `featured` image. |
| `highlightCurrentMenuArea` | _Not set_ | Marks menu entries in the main manu when selected |
| `smartTOC` | _Not set_ | Activate smart Table of Contents, items in view will be highlighted. |
| `smartTOCHideUnfocusedChildren` | _Not set_ | When smart Table of Contents is turned on, this will hide deeper levels of the table when they are not in focus. |
### Header
| Name | Default | Description |
| --------------- | --------- | --------------------------------------------------------------------------------- |
| --------------- | --------- | ------------------------------------------------------------------------------------------------------------------- |
| `header.layout` | `"basic"` | Defines the header for the entire site, supported values are `basic`, `fixed`, `fixed-fill`, and `fixed-fill-blur`. |
### Footer

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -13,6 +13,7 @@
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}

View file

@ -40,6 +40,7 @@
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}