Browse Source

shortcode to render a local screenshot of a remote resource

pull/10/head
Nicolas Massé 1 year ago
parent
commit
0f6c00e6a5
  1. 6
      layouts/shortcodes/screenshotOf.html

6
layouts/shortcodes/screenshotOf.html

@ -0,0 +1,6 @@
<!-- This shortcode renders an image linked to a resource somewhere -->
{{- $filename := .Get "src" -}}
{{- $image := .Page.Resources.GetMatch (printf "%s" $filename) -}}
<a href="{{- .Get "href" | plainify -}}">
<img src="{{ $image.RelPermalink }}">
</a>
Loading…
Cancel
Save