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:
authorGöran S <support@appernetic.io>2018-08-31 20:08:15 +0300
committerGöran S <support@appernetic.io>2018-08-31 20:08:15 +0300
commitf9aaac85a069e662a4d52352f9c51b360b3b13b3 (patch)
treebbe4e803a09426734950a7bf23979c0be50ba344
parentfa817413f6088326170aa9eec08bf718ad38d3e0 (diff)
Modify author link
-rw-r--r--layouts/partials/category.html28
-rw-r--r--layouts/partials/portfolio.html18
2 files changed, 35 insertions, 11 deletions
diff --git a/layouts/partials/category.html b/layouts/partials/category.html
index ac014c3..e392161 100644
--- a/layouts/partials/category.html
+++ b/layouts/partials/category.html
@@ -13,6 +13,15 @@
<h1 class="screen-reader-text">Posts</h1>
<div id="loop-container" class="loop-container">
{{ range $index, $element := (where .Data.Pages "Section" "post") }}
+
+ {{ $scratch := newScratch }}
+ {{ if .Site.Params.writers }}
+ {{ $scratch.Set "writer" (index .Site.Params.writers (lower .Params.writer) | default dict) }}
+ {{ else }}
+ {{ $scratch.Set "writer" .Site.Params.social | default dict }}
+ {{ end }}
+ {{ $writer := $scratch.Get "writer" }}
+
{{ 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">
@@ -29,18 +38,23 @@
<div class="excerpt-container">
<div class="excerpt-meta">
- <span class="date">{{ .Date.Format "02 January" }}</span> <span> / </span>
+ <span class="date">{{ .Date.Format "02 January" }}</span>
+
- {{ if and (isset .Site.Params "author") .Site.Params.author }}
- <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>
+ {{ if and (isset .Site.Params "author") .Site.Params.author }}
+ <span> / </span>
+ <span class="author">
+ <a href="{{ $writer.link | default .Site.Params.authorlink | absURL }}" title="Posts by {{ .Params.writer | default .Site.Params.author }}" rel="author">{{ .Params.writer | default .Site.Params.author }}</a>
+ </span>
+ {{ end }}
{{ else }}
- {{ .Site.Params.author | default "" }}
+ <span class="author">
+ {{ .Params.writer | default .Site.Params.author }}
+ </span>
{{ end }}
- </span>
- {{ end }}
+
{{ range .Params.categories }}
<span> / </span>
diff --git a/layouts/partials/portfolio.html b/layouts/partials/portfolio.html
index 4db2f15..cbaaad4 100644
--- a/layouts/partials/portfolio.html
+++ b/layouts/partials/portfolio.html
@@ -9,7 +9,7 @@
{{ else }}
{{ $scratch.Set "writer" .Site.Params.social | default dict }}
{{ end }}
- {{ $writer := $scratch.Get "writer" }}
+ {{ $writer := $scratch.Get "writer" }}
{{ 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">
@@ -28,12 +28,22 @@
{{ end }}
<div class="excerpt-container">
<div class="excerpt-meta">
- <span class="date">{{ .Date.Format "02 January" }}</span> <span> / </span>
-
+ <span class="date">{{ .Date.Format "02 January" }}</span>
+ {{ if and (isset .Site.Params "authorlink") .Site.Params.authorLink }}
+ {{ if and (isset .Site.Params "author") .Site.Params.author }}
+ <span> / </span>
+ <span class="author">
+ <a href="{{ $writer.link | default .Site.Params.authorlink | absURL }}" title="Posts by {{ .Params.writer | default .Site.Params.author }}" rel="author">{{ .Params.writer | default .Site.Params.author }}</a>
+ </span>
+ {{ end }}
+ {{ else }}
<span class="author">
- <a href="{{ $writer.link | default "" | absURL }}" title="Posts by {{ .Params.writer }}" rel="author">{{ .Params.writer }}</a>
+ {{ .Params.writer | default .Site.Params.author }}
</span>
+ {{ end }}
+
+
{{ range .Params.categories }}
<span> / </span>