Add multiple authors
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<article>
|
||||
{{ partial "paige-title.html" . }}
|
||||
{{ partial "paige-description.html" . }}
|
||||
{{ partial "paige-date.html" . }}
|
||||
{{ partial "paige-metadata.html" . }}
|
||||
{{ with .Params.stretch }}
|
||||
<div class="mb-3 mw-100 rounded-4 shadow" style="background-image: url('{{ relLangURL . }}'); background-position: center; background-size: cover; height: 20rem"></div>
|
||||
{{ end }}
|
||||
|
@@ -42,7 +42,7 @@
|
||||
{{ end }}
|
||||
{{ range $pages }}
|
||||
<item>
|
||||
{{ with .Site.Author.email }}
|
||||
{{ with partial "paige-authors.html" . }}
|
||||
<author>{{ . }}</author>
|
||||
{{ end }}
|
||||
{{ if .Content }}
|
||||
@@ -58,7 +58,7 @@
|
||||
<pubDate>{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ end }}
|
||||
{{ with .Title }}
|
||||
<title>{{ . }}</title>
|
||||
<title>{{ . | markdownify | plainify | htmlUnescape }}</title>
|
||||
{{ end }}
|
||||
</item>
|
||||
{{ end }}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<article>
|
||||
{{ partial "paige-title.html" . }}
|
||||
{{ partial "paige-description.html" . }}
|
||||
{{ partial "paige-date.html" . }}
|
||||
{{ partial "paige-metadata.html" . }}
|
||||
{{ partial "paige-content.html" . }}
|
||||
</article>
|
||||
|
17
layouts/partials/paige-authors.html
Normal file
17
layouts/partials/paige-authors.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ $result := "" }}
|
||||
{{ if .Params.authors }}
|
||||
{{ $names := slice }}
|
||||
{{ range .Params.authors }}
|
||||
{{ $names = $names | append (index site.Params.authors . "name" | default .) }}
|
||||
{{ end }}
|
||||
{{ $result = delimit $names ", " }}
|
||||
{{ else if .Site.Params.authors }}
|
||||
{{ $names := slice }}
|
||||
{{ range $k, $v := .Site.Params.authors }}
|
||||
{{ if eq $v.default true }}
|
||||
{{ $names = $names | append $v.name }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $result = delimit $names ", " }}
|
||||
{{ end }}
|
||||
{{ return $result }}
|
@@ -1,7 +0,0 @@
|
||||
{{ with .PublishDate }}
|
||||
{{ $format := ":date_long" }}
|
||||
{{ with site.Params.paige.date_format }}
|
||||
{{ $format = . }}
|
||||
{{ end }}
|
||||
<p class="text-center text-muted"><time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $format . }}</time></p>
|
||||
{{ end }}
|
8
layouts/partials/paige-metadata.html
Normal file
8
layouts/partials/paige-metadata.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ $authors := partial "paige-authors.html" . }}
|
||||
{{ if or $authors .PublishDate}}
|
||||
<p class="text-center text-muted">
|
||||
{{- with $authors }}{{ . }}{{ end -}}
|
||||
{{- if and $authors .PublishDate }}<br>{{ end -}}
|
||||
{{- with .PublishDate }}<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format (site.Params.paige.date_format | default ":date_long") . }}</time>{{ end -}}
|
||||
</p>
|
||||
{{ end }}
|
Reference in New Issue
Block a user