Files
hugo-book/layouts/_shortcodes/image.html

11 lines
565 B
HTML

{{- $destination := partial "docs/links/portable-image" (dict "Page" .Page "Destination" (.Get "src")) -}}
<label class="book-image" for="book-image-toggle-{{ .Ordinal }}">
<input class="hidden toggle" type="checkbox" id="book-image-toggle-{{ .Ordinal }}" />
<img src="{{ $destination | safeURL }}"
{{- with .Get "alt"}} alt="{{ . }}"{{ end -}}
{{- with .Get "title"}} title="{{ . }}"{{ end -}}
{{- with .Get "loading"}} loading="{{ . }}"{{ end -}}
{{- with .Get "class"}} class="{{ . }}"{{ end -}}
/>
</label>
{{- /* remove whitespaces */ -}}