This commit is contained in:
parent
1969926aae
commit
71aca4ea14
7 changed files with 25 additions and 2 deletions
15
layouts/shortcodes/image.html
Normal file
15
layouts/shortcodes/image.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{ $src := .Get "src" }}
|
||||
{{ $alt := .Get "alt" | default "" }}
|
||||
{{ $img := resources.Get $src }}
|
||||
|
||||
{{ if not $img }}
|
||||
{{ errorf "Bild '%s' nicht gefunden. Achte darauf, dass es in /assets/ liegt." $src }}
|
||||
{{ end }}
|
||||
|
||||
{{ $resized := $img.Resize "1000x" }}
|
||||
|
||||
<img
|
||||
src="{{ $resized.RelPermalink }}"
|
||||
alt="{{ $alt }}"
|
||||
loading="lazy"
|
||||
style="max-width: 100%; height: auto;">
|
Loading…
Add table
Add a link
Reference in a new issue