Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/appernetic/hugo-nederburg-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Herman <lherman.cs@gmail.com>2018-07-28 01:29:10 +0300
committerLukas Herman <lherman.cs@gmail.com>2018-08-08 01:49:33 +0300
commit9ade469e09801bcad5e0c20277d55fcc6673f14c (patch)
tree0db7e61e998226ce13879e376fc9929dbc80f03f
parent8528dbcf317aa3cea0820a5e465357f08321deda (diff)
Added multiple writers support to portfolio
-rw-r--r--layouts/partials/portfolio.html10
1 files changed, 4 insertions, 6 deletions
diff --git a/layouts/partials/portfolio.html b/layouts/partials/portfolio.html
index 42a8650..9b44653 100644
--- a/layouts/partials/portfolio.html
+++ b/layouts/partials/portfolio.html
@@ -3,6 +3,8 @@
<div id="loop-container" class="loop-container">
{{ $paginator := .Paginate (where (where .Site.Pages "Type" "post") "IsPage" true) }}
{{ range $index, $element := .Paginator.Pages }}
+ {{ $has_writer := isset .Site.Params.writers (lower .Params.writer) }}
+ {{ $writer := index .Site.Params.writers (lower .Params.writer) | default dict }}
{{ if and (isset .Params "image") .Params.image }}
{{ if eq (mod $index 2) 0 }}
<div class="post type-post status-publish format-standard has-post-thumbnail hentry category-design tag-memories tag-normal-post tag-standard-2 excerpt zoom full-without-featured odd excerpt">
@@ -23,14 +25,10 @@
<div class="excerpt-meta">
<span class="date">{{ .Date.Format "02 January" }}</span> <span> / </span>
- {{ if and (isset .Site.Params "author") .Site.Params.author }}
+ {{ if $has_writer }}
<span class="author">
- {{ if and (isset .Site.Params "authorlink") .Site.Params.authorLink }}
- <a href="{{ .Site.Params.authorLink | default "" | absURL }}" title="Posts by {{ .Site.Params.author | default "" }}" rel="author">{{ .Site.Params.author | default "" }}</a>
- {{ else }}
- {{ .Site.Params.author | default "" }}
- {{ end }}
+ <a href="{{ $writer.link | default "" | absURL }}" title="Posts by {{ .Params.writer }}" rel="author">{{ .Params.writer }}</a>
</span>
{{ end }}