diff options
author | Jonathan Janssens <jonathan.janssens@gmail.com> | 2019-11-03 13:30:24 +0300 |
---|---|---|
committer | Jonathan Janssens <jonathan.janssens@gmail.com> | 2019-11-03 13:30:24 +0300 |
commit | aba53b351c5f499fb0e7d3971f1ead623871c14f (patch) | |
tree | 807121ba45540fdd09e036ce714892556236bcfb | |
parent | 9f84b9dfea3cea69d469749f695710244b3b29d3 (diff) |
add: author to single page
-rw-r--r-- | layouts/_default/single.html | 11 | ||||
-rw-r--r-- | layouts/partials/post-author.html | 13 |
2 files changed, 21 insertions, 3 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a1ed959..da8df43 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -29,12 +29,17 @@ <div class="post-full-byline"> <section class="post-full-byline-content"> + {{ if .Param "author" }} + {{- partial "post-author.html" . -}} + {{ end }} + <section class="post-full-byline-meta"> + {{ if .Param "author" }} + <h4 class="author-name">{{ .Param "author" }}</h4> + {{ end }} <div class="byline-meta-content"> <time class="byline-meta-date" datetime="{{.Date.Format "2006-31-01"}}">{{.Date.Format "2 January 2006"}}</time> - {{ if .Param "read_time" }} - <span class="byline-reading-time"><span class="bull">•</span> {{ .Param "read_time" }} read</span> - {{ end }} + <span class="byline-reading-time"><span class="bull">•</span> {{ .ReadingTime }} min read</span> </div> </section> diff --git a/layouts/partials/post-author.html b/layouts/partials/post-author.html new file mode 100644 index 0000000..d82313d --- /dev/null +++ b/layouts/partials/post-author.html @@ -0,0 +1,13 @@ +<ul class="author-list"> + <li class="author-list-item"> + <div class="author-card"> + <div class="author-profile-image">{{- partial "icons/avatar.html" -}}</div> + <div class="author-info"> + <div class="author-info"> + <h2>{{ .Param "author" }}</h2> + </div> + </div> + </div> + <a href="#" class="author-avatar author-profile-image">{{- partial "icons/avatar.html" -}}</a> + </li> +</ul>
\ No newline at end of file |