Permalink
Browse files

posts: Add option to display author names

Close #220
  • Loading branch information...
gcushen committed Jun 29, 2018
1 parent 9b1be10 commit 9e65c45d23c0cdd55a9663c40eeafa9c8936b73e
Showing with 16 additions and 0 deletions.
  1. +3 −0 archetypes/post.md
  2. +3 −0 exampleSite/content/post/getting-started.md
  3. +10 −0 layouts/partials/article_metadata.html
View
@@ -3,6 +3,9 @@ title = "{{ replace .TranslationBaseName "-" " " | title }}"
date = {{ .Date }}
draft = false
# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
authors = []
# Tags and categories
# For example, use `tags = []` for no tags, or the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
tags = []
@@ -5,6 +5,9 @@ date = 2016-04-20T00:00:00
lastmod = 2018-01-13T00:00:00
draft = false
# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
authors = []
tags = ["academic"]
summary = "Create a beautifully simple website or blog in under 10 minutes."
@@ -2,6 +2,16 @@
{{ $ := .content }}
<div class="article-metadata">
{{ if $.Params.authors }}
{{ $authorLen := len $.Params.authors }}
<div itemprop="author">
{{ range $k, $v := $.Params.authors }}
{{- $v -}}
{{- if lt $k (sub $authorLen 1) -}}, {{ end }}
{{ end }}
</div>
{{ end }}
<span class="article-date">
{{ if ne $.Params.Lastmod $.Params.Date }}
{{ i18n "last_updated" }}

0 comments on commit 9e65c45

Please sign in to comment.