Skip to content

Instantly share code, notes, and snippets.

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">
<a href="{{.RelPermalink}}">
{{ (.Resize "320x").RelPermalink }} 320w,
{{ (.Resize "600x").RelPermalink }} 600w,
{{ (.Resize "1200x").RelPermalink }} 2x"
src="{{ (.Resize "600x").RelPermalink }}" alt="{{$altText}}"/>
<figcaption><p>{{ $caption }}</p>{{ if $source }}<p><a href="{{ $source }}">source</a></p>{{ end }}</figcaption>
{{ 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="" >}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment