Add ability to attribute photos in posts

This commit is contained in:
Joe Hutchinson
2021-02-03 21:10:11 -05:00
parent 83846edbad
commit baddc0cc0e
2 changed files with 10 additions and 0 deletions

View File

@@ -13,4 +13,7 @@ resources:
src: ""
params:
description: ""
attribution:
name: ""
link: ""
---

View File

@@ -18,6 +18,13 @@
<source srcset="{{ $featured.Permalink }}">
<img src="{{ $featured.Permalink }}" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
</picture>
{{ with .Params.attribution -}}
<small>Picture by&nbsp;
{{- with .link }}<a href="{{ . }}" target="_blank" rel="noreferrer noopener">{{ end -}}
{{- .name -}}
{{- with .link }}</a>{{ end -}}
</small>
{{- end }}
{{- end }}
{{ if .Params.toc -}}
<h2>Contents</h2>