Past Sketches – part 2
Originally posted on: sketches Fountain Pens hugoUpdated on:I updated setup on hugo a little, now scaled down images will be presented, which are automatically generated using Image Processing and Markdown Render Hooks.
Seras Victoria from Hellsing Who knows… King from One-Punch Man Usagi Tsukino from Sailor Moon and Grid
Magic Code
Following snippet will generate preview images with width of 800px, save it in
following path: layouts/_default/_markup/render-image.html
.
{{ $src := resources.GetMatch (.Destination) }}
{{ $small := $src.Resize "800x" }}
<figure><a href={{ $src.RelPermalink }}><img
src="{{ $src.RelPermalink }}" alt="{{ .Text }}"
{{ if ge $src.Width "800"}}srcset='{{ $small.RelPermalink }} 800w'{{ end }}/></a>
{{ if .Title }}<figcaption><h4>{{ .Title }}</h4></figcaption>{{ end }}
</figure>