diff options
author | dataCobra <datacobra@thinkbot.de> | 2021-03-26 15:12:50 +0300 |
---|---|---|
committer | dataCobra <datacobra@thinkbot.de> | 2021-03-26 15:12:50 +0300 |
commit | bd1ff2367733f8029b59df0e175d2659a31920a2 (patch) | |
tree | d5b8cfab5c11e0c7ce252f850d9b65daa4e69adf | |
parent | 0442e429b6a38c62291b051eb0447ec16831e2cc (diff) |
Refactoring tag for .Params.author
-rw-r--r-- | layouts/_default/list.html | 14 | ||||
-rw-r--r-- | layouts/index.html | 14 |
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> |