Merge pull request #15 from mntn-xyz/patch-11

Only show aside data if relevant front matter data is present
This commit is contained in:
Joe Roe 2021-08-09 13:31:13 +02:00 committed by GitHub
commit 8408382ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -9,6 +9,11 @@
{{ end }} {{ end }}
{{define "aside" }} {{define "aside" }}
<p>{{ .Params.description }}</p> {{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
<p>By {{ .Params.author }}, {{ .Date.Format "2 January 2006" }}</p> {{ if or (.Params.author) (.Params.date) }}
<p>
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }}
{{ if .Date }}{{ .Date.Format "2 January 2006" }}{{ end }}
</p>
{{ end }}
{{ end }} {{ end }}