Add old draft post and new raw HTML shortcode.
This commit is contained in:
20
layouts/shortcodes/imgproc.html
Normal file
20
layouts/shortcodes/imgproc.html
Normal file
@ -0,0 +1,20 @@
|
||||
{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
|
||||
{{ $imgdata := imageConfig (printf "/content/%s" $original.RelPermalink) }}
|
||||
{{ if (gt $imgdata.Width 1500) }}
|
||||
{{ .Scratch.Set "image" ($original.Resize "1500x") }}
|
||||
{{ else if (gt $imgdata.Height 1500) }}
|
||||
{{ .Scratch.Set "image" ($original.Resize "x1500") }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "image" $original }}
|
||||
{{ end }}
|
||||
|
||||
{{ $image := .Scratch.Get "image" }}
|
||||
|
||||
<figure style="padding: 0.25rem; margin: 2rem 0;">
|
||||
<a href="{{ $original.RelPermalink }}">
|
||||
<img style="max-width: 100%; width: auto; height: auto;" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
|
||||
</a>
|
||||
<figcaption>
|
||||
{{ .Inner | markdownify }}
|
||||
</figcaption>
|
||||
</figure>
|
1
layouts/shortcodes/raw.html
Normal file
1
layouts/shortcodes/raw.html
Normal file
@ -0,0 +1 @@
|
||||
{{.Inner}}
|
Reference in New Issue
Block a user