mirror of https://github.com/jpanther/congo.git
Merge 86dd65776f
into f31082dec8
commit
0d34a88d91
|
@ -12,6 +12,7 @@ autoSwitchAppearance = true
|
|||
enableSearch = true
|
||||
enableCodeCopy = true
|
||||
enableImageLazyLoading = true
|
||||
enableWebp = true
|
||||
|
||||
# robots = ""
|
||||
fingerprintAlgorithm = "sha256"
|
||||
|
|
|
@ -9,6 +9,10 @@ This article offers a sample of basic Markdown formatting that can be used in Co
|
|||
|
||||
<!--more-->
|
||||
|
||||
## Image
|
||||
|
||||
![sample image](thumb-surendran-mp-IhWYiwSxm8g-unsplash.jpg)
|
||||
|
||||
## Headings
|
||||
|
||||
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
|
||||
|
|
|
@ -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
|
||||
|
@ -23,6 +24,24 @@
|
|||
{{ end }}
|
||||
{{ with $resource }}
|
||||
<figure>
|
||||
<picture>
|
||||
{{ if (and (ne .MediaType.SubType "svg") $webp) }}
|
||||
<source
|
||||
{{ if lt .Width 660 }}
|
||||
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
|
||||
src="{{ .RelPermalink }}"
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
srcset="
|
||||
{{- (.Resize "330x webp").RelPermalink }} 330w,
|
||||
{{- (.Resize "660x webp").RelPermalink }} 660w,
|
||||
{{- (.Resize "1024x webp").RelPermalink }} 1024w,
|
||||
{{- (.Resize "1320x webp").RelPermalink }} 2x"
|
||||
src="{{ (.Resize "660x webp").RelPermalink }}"
|
||||
{{ end }}
|
||||
type="image/webp"
|
||||
/>
|
||||
{{ end }}
|
||||
<img
|
||||
class="mx-auto my-0 rounded-md"
|
||||
{{ if eq .MediaType.SubType "svg" }}
|
||||
|
@ -30,6 +49,7 @@
|
|||
{{ else }}
|
||||
width="{{ .Width }}"
|
||||
height="{{ .Height }}"
|
||||
decoding="async"
|
||||
{{ if lt .Width 660 }}
|
||||
src="{{ .RelPermalink }}"
|
||||
{{ else }}
|
||||
|
@ -46,6 +66,7 @@
|
|||
loading="lazy"
|
||||
{{ end }}
|
||||
/>
|
||||
</picture>
|
||||
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ else }}
|
||||
|
|
Loading…
Reference in New Issue