mv theme to local control
This commit is contained in:
parent
3ac32ec7e9
commit
c980366d63
189 changed files with 22593 additions and 0 deletions
36
themes/aether/layouts/shortcodes/smallimg.html
Normal file
36
themes/aether/layouts/shortcodes/smallimg.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<picture class="small-pic {{ if eq .Params.clear "true" -}} clear {{- end }}">
|
||||
{{ 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 or (gt $image.Width 800) (and (isset .Params "width") (gt $image.Width (.Get "width"))) -}}
|
||||
{{ $.Scratch.Set "imgwidth" "800" }}
|
||||
{{ if and (isset .Params "width") (lt (.Get "width") 800) -}}
|
||||
{{ $.Scratch.Set "imgwidth" (trim (.Get "width") "px") }}
|
||||
{{- end }}
|
||||
{{ $resized := $image.Resize (printf "%sx Lanczos" ($.Scratch.Get "imgwidth")) }}
|
||||
<source srcset="{{ $resized.Permalink }}">
|
||||
<img src="{{ $resized.Permalink }}" class="small-img {{ if isset .Params "smartfloat" -}}
|
||||
{{- if eq .Params.smartfloat "left" -}}
|
||||
smartfloat-left
|
||||
{{- else if eq .Params.smartfloat "right" -}}
|
||||
smartfloat-right
|
||||
{{- end -}}
|
||||
{{- end }}"
|
||||
{{- with .Get "alt" }} alt="{{ . }}" {{ end -}}
|
||||
{{- with .Get "width" }} style="width: {{ . }};" {{- end -}}
|
||||
/>
|
||||
{{ else }}
|
||||
<source srcset="{{ $image.Permalink }}">
|
||||
<img src="{{ $image.Permalink }}" class="small-img {{ if isset .Params "smartfloat" -}}
|
||||
{{- if eq .Params.smartfloat "left" -}}
|
||||
smartfloat-left
|
||||
{{- else if eq .Params.smartfloat "right" -}}
|
||||
smartfloat-right
|
||||
{{- end -}}
|
||||
{{- end }}"
|
||||
{{- with .Get "alt" }} alt="{{ . }}" {{ end -}}
|
||||
{{- with .Get "width" }} style="width: {{ . }};" {{- end -}}
|
||||
/>
|
||||
{{- end }}
|
||||
</picture>
|
||||
Loading…
Add table
Add a link
Reference in a new issue