mv theme to local control
This commit is contained in:
parent
3ac32ec7e9
commit
c980366d63
189 changed files with 22593 additions and 0 deletions
14
themes/aether/layouts/shortcodes/image.html
Normal file
14
themes/aether/layouts/shortcodes/image.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<picture>
|
||||
{{ if (fileExists (printf "%s/%s" "content" (replace (.Get "src") (path.Ext (.Get "src")) ".webp"))) -}}
|
||||
<source srcset="{{ replace (.Get "src") (path.Ext (.Get "src")) ".webp" | absURL }}" type="image/webp">
|
||||
{{- end }}
|
||||
{{ $image := $.Page.Resources.GetMatch (.Get "src") }}
|
||||
{{ if gt $image.Width 800 -}}
|
||||
{{ $resized := $image.Resize "800x Lanczos" }}
|
||||
<source srcset="{{ $resized.Permalink }}">
|
||||
<img src="{{ $resized.Permalink }}" {{ if isset .Params "alt" -}} alt="{{ .Get "alt"}}" {{- end }}>
|
||||
{{ else }}
|
||||
<source srcset="{{ $image.Permalink }}">
|
||||
<img src="{{ $image.Permalink }}" {{ if isset .Params "alt" -}} alt="{{ .Get "alt"}}" {{- end }}>
|
||||
{{- end}}
|
||||
</picture>
|
||||
Loading…
Add table
Add a link
Reference in a new issue