mirror of https://github.com/jpanther/congo.git
add configuration option
parent
d37a633509
commit
afa25640c3
|
@ -13,6 +13,7 @@ enableSearch = true
|
|||
enableCodeCopy = true
|
||||
enableImageLazyLoading = true
|
||||
enableWebp = true
|
||||
enableLqip = true
|
||||
|
||||
# robots = ""
|
||||
fingerprintAlgorithm = "sha256"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
{{ $lazyLoad := .context.Page.Site.Params.enableImageLazyLoading | default true }}
|
||||
{{ $webp := .context.Page.Site.Params.enableWebp | default true }}
|
||||
{{ $lqip := .context.Page.Site.Params.enableLqip | default true }}
|
||||
|
||||
{{ if findRE "^https?" $url.Scheme }}
|
||||
<img
|
||||
|
@ -22,7 +23,7 @@
|
|||
{{ $resource = resources.Get ($url.String) }}
|
||||
{{ end }}
|
||||
{{ with $resource }}
|
||||
{{ if ne .MediaType.SubType "svg" }}
|
||||
{{ if (and (ne .MediaType.SubType "svg") $lqip) }}
|
||||
{{ $lqip := (.Resize "20x webp").Content | base64Encode }}
|
||||
<picture
|
||||
style="background: url(data:image/webp;base64,{{ $lqip }}); background-size: cover"
|
||||
|
|
Loading…
Reference in New Issue