Clean up formatting of photo shortcode
This commit is contained in:
parent
3f1bd948eb
commit
0f47ca61a6
1 changed files with 6 additions and 5 deletions
|
@ -1,8 +1,9 @@
|
|||
{{- 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>
|
||||
{{- $thumbnail := partial "images/photo_thumbnail.html" (dict "Page" . "Width" 1280 "Height" 1280) -}}
|
||||
{{- $altText := $thumbnail.Params.alt | default .Title -}}
|
||||
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
|
||||
<img src="{{ $thumbnail.RelPermalink }}"{{ with $altText }} alt="{{ . }}"{{ end }}>
|
||||
</a>
|
||||
{{- else -}}
|
||||
{{- errorf "No page matching '%s'" (.Get 0) -}}
|
||||
{{- errorf "No page matching '%s'" (.Get 0) -}}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue