Skip to content

Commit 6756e59

Browse files
New template or individual blog post
1 parent 179bb37 commit 6756e59

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- define "main" }}
2+
<article>
3+
<h1>{{ .Title | safeHTML }}</h1>
4+
<p>
5+
Published <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>
6+
by
7+
{{- with .Params.authors }}
8+
{{- range $index, $author := . }}
9+
{{- if $index }}, {{ end }}
10+
{{- $.Scratch.Set "found" false }}
11+
{{- range $key, $val := site.Data.people }}
12+
{{- if eq $val.name $author }}
13+
{{- $.Scratch.Set "found" true }}
14+
<a rel="author" href="{{ $val.web }}">{{ $val.name }}</a>
15+
{{- end }}
16+
{{- end }}
17+
{{- if not ($.Scratch.Get "found") }}
18+
<span >{{ $author }}</span>
19+
{{- end }}
20+
{{- end }}
21+
{{- end }}
22+
</p>
23+
{{- .Content }}
24+
</article>
25+
{{- end }}

0 commit comments

Comments
 (0)