Add a shortcode to embed a photo post in a blog post
This commit is contained in:
parent
e7b2cb493a
commit
57947282ce
2 changed files with 16 additions and 0 deletions
8
layouts/shortcodes/photo.html
Normal file
8
layouts/shortcodes/photo.html
Normal 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 -}}
|
Loading…
Add table
Add a link
Reference in a new issue