diff options
author | danielkvist <d94.zaragoza@gmail.com> | 2019-01-09 20:28:14 +0300 |
---|---|---|
committer | danielkvist <d94.zaragoza@gmail.com> | 2019-01-09 20:28:14 +0300 |
commit | 314e1c6852039fda43337eebf2e1064582118671 (patch) | |
tree | 4489fab9a0b241f0940e758b555b3dfe52559b6a /layouts | |
parent | 1a6cbb2a75041c1204a655cbed730b83ae135384 (diff) |
improve author and date info
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/card.html | 11 | ||||
-rw-r--r-- | layouts/_default/single.html | 11 |
2 files changed, 15 insertions, 7 deletions
diff --git a/layouts/_default/card.html b/layouts/_default/card.html index 0956f65..6a184f1 100644 --- a/layouts/_default/card.html +++ b/layouts/_default/card.html @@ -5,12 +5,17 @@ {{ .Title }} </a> </h1> - {{ if $.Site.Params.posts.showDate }} + {{ if ne .Type "page" }} + {{ if and $.Site.Params.posts.showDate $.Site.Params.posts.showAuthor }} + <p class="card__header__date date"> + {{ dateFormat $.Site.Params.posts.dateFormat .Date }} By {{ $.Params.author }}. + </p> + {{ else if $.Site.Params.posts.showDate }} <p class="card__header__date date">{{ dateFormat $.Site.Params.posts.dateFormat .Date }}</p> - {{ end }} - {{ if $.Site.Params.posts.showAuthor }} + {{ else if $.Site.Params.posts.showAuthor }} <p class="card__header__author author">By {{ $.Params.author }}.</p> {{ end }} + {{ end }} </header> <main class="card__body"> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3cc1532..9176a3b 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,11 +6,14 @@ <p class="post__subtitle">{{ .Description }}</p> {{ end }} {{ if ne .Type "page" }} - {{ if $.Site.Params.posts.showAuthor }} - <p class="post__author author">By {{ $.Params.author }}.</p> - {{ end }} - {{ if $.Site.Params.posts.showDate }} + {{ if and $.Site.Params.posts.showDate $.Site.Params.posts.showAuthor }} + <p class="post__date date"> + {{ dateFormat $.Site.Params.posts.dateFormat .Date }} By {{ $.Params.author }}. + </p> + {{ else if $.Site.Params.posts.showDate }} <p class="post__date date">{{ dateFormat $.Site.Params.posts.dateFormat .Date }}</p> + {{ else if $.Site.Params.posts.showAuthor }} + <p class="post__author author">By {{ $.Params.author }}.</p> {{ end }} {{ end }} </header> |