Add a shortcode to embed a photo post in a blog post

This commit is contained in:
Eryn Wells 2022-10-30 11:31:47 -07:00
parent e7b2cb493a
commit 57947282ce
2 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,8 @@
{{- with $photoPage := $.Page.GetPage (printf "photos/%s" (.Get 0)) -}}
{{- $thumbnail := partial "images/photo_thumbnail.html" (dict "Page" . "Width" 1280 "Height" 1280) -}}
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
<img src="{{ $thumbnail.RelPermalink }}" {{/*{{ with $altText }}alt="{{ . }}"{{ end }}*/}}>
</a>
{{- else -}}
{{- errorf "No page matching '%s'" (.Get 0) -}}
{{- end -}}