mirror of https://github.com/jpanther/congo.git
Add configuration flag
parent
759982fd4a
commit
86dd65776f
|
@ -12,6 +12,7 @@ autoSwitchAppearance = true
|
||||||
enableSearch = true
|
enableSearch = true
|
||||||
enableCodeCopy = true
|
enableCodeCopy = true
|
||||||
enableImageLazyLoading = true
|
enableImageLazyLoading = true
|
||||||
|
enableWebp = true
|
||||||
|
|
||||||
# robots = ""
|
# robots = ""
|
||||||
fingerprintAlgorithm = "sha256"
|
fingerprintAlgorithm = "sha256"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
{{ $altText := .Text }}
|
{{ $altText := .Text }}
|
||||||
{{ $caption := .Title }}
|
{{ $caption := .Title }}
|
||||||
{{ $lazyLoad := $.Page.Site.Params.enableImageLazyLoading | default true }}
|
{{ $lazyLoad := $.Page.Site.Params.enableImageLazyLoading | default true }}
|
||||||
|
{{ $webp := $.Page.Site.Params.enableWebp | default true }}
|
||||||
{{ if findRE "^https?" $url.Scheme }}
|
{{ if findRE "^https?" $url.Scheme }}
|
||||||
<figure>
|
<figure>
|
||||||
<img
|
<img
|
||||||
|
@ -24,7 +25,7 @@
|
||||||
{{ with $resource }}
|
{{ with $resource }}
|
||||||
<figure>
|
<figure>
|
||||||
<picture>
|
<picture>
|
||||||
{{ if ne .MediaType.SubType "svg" }}
|
{{ if (and (ne .MediaType.SubType "svg") $webp) }}
|
||||||
<source
|
<source
|
||||||
{{ if lt .Width 660 }}
|
{{ if lt .Width 660 }}
|
||||||
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
|
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
|
||||||
|
|
Loading…
Reference in New Issue