Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{{ $altText := .Get "alt"}}
{{ $caption := .Get "caption"}}
{{ $source := .Get "source"}}
{{ with $.Page.Resources.GetMatch (.Get "name") }}
<div class="post-image">
<figure>
<a href="{{.RelPermalink}}">
<img
srcset="
{{ (.Resize "320x").RelPermalink }} 320w,
{{ (.Resize "600x").RelPermalink }} 600w,
{{ (.Resize "1200x").RelPermalink }} 2x"
src="{{ (.Resize "600x").RelPermalink }}" alt="{{$altText}}"/>
</a>
<figcaption><p>{{ $caption }}</p>{{ if $source }}<p><a href="{{ $source }}">source</a></p>{{ end }}</figcaption>
</figure>
</div>
{{ else }}
could not find image
{{ end }}
{{< bundle-image name="old_galileo.png" alt="A Photo of the Old Galileo." caption="This is how the Galileo looked in 2001 and how I remember it" source="https://web.archive.org/web/20190130014421/https://voyagerslog.blogspot.com/2016/03/a-tribute-to-first-galileo-as-she.html" >}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.