FIX theme toggler CHANGE image optimization ADD custom markdown image rendering
This commit is contained in:
parent
a841050e84
commit
07f46720f8
11 changed files with 81 additions and 59 deletions
|
@ -1,5 +1,5 @@
|
|||
<!--
|
||||
type: string - default
|
||||
type: string - default empty
|
||||
url: string
|
||||
alt: string
|
||||
width: int
|
||||
|
@ -9,6 +9,7 @@ height: int
|
|||
{{ $ext := path.Ext .url }}
|
||||
{{ $name := path.Base (replace .url $ext "") }}
|
||||
{{ $dir := path.Dir .url }}
|
||||
{{ $mediaWidthControl := "(min-width: 1240px) 50px, 70vw" }}
|
||||
|
||||
<picture>
|
||||
<source
|
||||
|
@ -19,6 +20,7 @@ height: int
|
|||
{{ end }}
|
||||
{{ .url }}.avif {{ .width }}w
|
||||
"
|
||||
sizes="{{ $mediaWidthControl }}"
|
||||
/>
|
||||
<source
|
||||
type="image/webp"
|
||||
|
@ -28,6 +30,7 @@ height: int
|
|||
{{ end }}
|
||||
{{ .url }}.webp {{ .width }}w
|
||||
"
|
||||
sizes="{{ $mediaWidthControl }}"
|
||||
/>
|
||||
<img
|
||||
class="{{ .type }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue