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