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

github.com/dataCobra/hugo-vitae.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordataCobra <datacobra@thinkbot.de>2021-03-26 15:12:50 +0300
committerdataCobra <datacobra@thinkbot.de>2021-03-26 15:12:50 +0300
commitbd1ff2367733f8029b59df0e175d2659a31920a2 (patch)
treed5b8cfab5c11e0c7ce252f850d9b65daa4e69adf
parent0442e429b6a38c62291b051eb0447ec16831e2cc (diff)
Refactoring tag for .Params.author
-rw-r--r--layouts/_default/list.html14
-rw-r--r--layouts/index.html14
2 files changed, 14 insertions, 14 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 67e98a8..7f93a56 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -19,17 +19,17 @@
</div>
<div class="matter">
<h3 class="title small"><a href="{{ .RelPermalink }}">{{.Title}}{{ if .Draft }}<sup class="draft-label">DRAFT</sup>{{ end }}</a></h3>
-<div class="author">
{{- if eq .Site.Params.listAuthor true }}
-{{- if isset .Params "author" }}
-{{- if isset .Params "authorlink" }}
+<div class="author">
+{{- if isset .Params "author" -}}
+{{- if isset .Params "authorlink" -}}
{{ i18n "authorpretext" }} <a href="{{ relURL .Params.authorlink }}" target="_blank" rel="noopener noreferrer">{{ .Params.author }}</a>
-{{- else }}
+{{- else -}}
{{ i18n "authorpretext" }} {{ .Params.author }}
-{{- end }}
-{{- end }}
-{{- end }}
+{{- end -}}
+{{- end -}}
</div>
+{{- end }}
<span class="description">{{ if isset .Params "description" }}{{ .Description }}{{ else }}{{ .Plain | htmlUnescape | safeHTML | truncate 140 }}{{ end }}</span>
</div>
</div>
diff --git a/layouts/index.html b/layouts/index.html
index dbcdefa..a8f66a0 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -14,17 +14,17 @@
</div>
<div class="matter">
<h3 class="title small"><a href="{{ .RelPermalink }}">{{.Title}}{{ if .Draft }}<sup class="draft-label">DRAFT</sup>{{ end }}</a></h3>
+{{- if eq .Site.Params.listAuthor true }}
<div class="author">
-{{- if eq .Site.Params.listAuthor true}}
-{{- if isset .Params "author" }}
-{{- if isset .Params "authorlink" }}
+{{- if isset .Params "author" -}}
+{{- if isset .Params "authorlink" -}}
{{ i18n "authorpretext" }} <a href="{{ relURL .Params.authorlink }}" target="_blank" rel="noopener noreferrer">{{ .Params.author }}</a>
-{{- else }}
+{{- else -}}
{{ i18n "authorpretext" }} {{ .Params.author }}
-{{- end }}
-{{- end }}
-{{- end }}
+{{- end -}}
+{{- end -}}
</div>
+{{- end }}
<span class="description">{{ if isset .Params "description" }}{{ .Description }}{{ else }}{{ .Plain | htmlUnescape | safeHTML | truncate 140 }}{{ end }}</span>
</div>
</div>