diff options
-rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
-rw-r--r-- | layouts/_default/list.html | 21 | ||||
-rw-r--r-- | layouts/_default/rss.xml | 10 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 19 | ||||
-rw-r--r-- | layouts/partials/head.html | 2 |
6 files changed, 36 insertions, 19 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4c471bb..5a208ae 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -12,3 +12,4 @@ collaboration of others. * [Jon Besga](https://github.com/jonbesga) * [Mochammad Ihza Rizky Karim](https://github.com/ihzarizkyk) * [Bernardo Ayala](https://github.com/nardoyala) +* [Mattia Panzeri](https://github.com/panz3r) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index aa36069..2e3a8d8 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -19,14 +19,23 @@ </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" }} + {{ i18n "authorpretext" }} <a href="{{ relURL .Params.authorlink }}" target="_blank" rel="noopener noreferrer">{{ .Params.author }}</a> + {{ else }} + {{ i18n "authorpretext" }} {{ .Params.author }} + {{ end }} + {{ end }} + {{ end }} + </div> <span class="description"> - {{ if isset .Params "description" }} + {{ if isset .Params "description" }} {{ .Description }} - {{ else if gt (len .Plain) 120 }} - {{ slicestr .Plain 0 120 | htmlUnescape }}... - {{ else }} - {{ .Plain | htmlUnescape }} - {{ end }} + {{ else }} + {{ .Plain | htmlUnescape | safeHTML | truncate 140 }} + {{ end }} </span> </div> </div> diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 4acb190..b1a586c 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -42,13 +42,11 @@ {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} <guid>{{ .Permalink }}</guid> <description> - {{ if isset .Params "description" }} + {{ if isset .Params "description" }} {{ .Description }} - {{ else if gt (len .Plain) 120 }} - {{ slicestr .Plain 0 120 | htmlUnescape }}... - {{ else }} - {{ .Plain | htmlUnescape }} - {{ end }} + {{ else }} + {{ .Plain | htmlUnescape | safeHTML | truncate 140 }} + {{ end }} </description> </item> {{ end -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4352a5b..1b963be 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -10,7 +10,7 @@ {{ if isset .Params "author" }} <p> {{ if isset .Params "authorlink" }} - {{ i18n "authorpretext" }} <a href="{{ relURL .Params.authorlink }}">{{ .Params.author }}</a> + {{ i18n "authorpretext" }} <a href="{{ relURL .Params.authorlink }}" target="_blank" rel="noopener noreferrer">{{ .Params.author }}</a> {{ else }} {{ i18n "authorpretext" }} {{ .Params.author }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 2954d79..5263aff 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -12,7 +12,7 @@ {{ if isset .Params "author" }} <p> {{ if isset .Params "authorlink" }} - {{ i18n "authorpretext" }} <a href="{{ relURL .Params.authorlink }}">{{ .Params.author }}</a> + {{ i18n "authorpretext" }} <a href="{{ relURL .Params.authorlink }}" target="_blank" rel="noopener noreferrer">{{ .Params.author }}</a> {{ else }} {{ i18n "authorpretext" }} {{ .Params.author }} {{ end }} @@ -70,13 +70,22 @@ </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" }} + {{ i18n "authorpretext" }} <a href="{{ relURL .Params.authorlink }}" target="_blank" rel="noopener noreferrer">{{ .Params.author }}</a> + {{ else }} + {{ i18n "authorpretext" }} {{ .Params.author }} + {{ end }} + {{ end }} + {{ end }} + </div> <span class="description"> {{ if isset .Params "description" }} - {{ .Description }} - {{ else if gt (len .Plain) 120 }} - {{ slicestr .Plain 0 120 | htmlUnescape }}... + {{ .Description }} {{ else }} - {{ .Plain | htmlUnescape }} + {{ .Plain | htmlUnescape | safeHTML | truncate 140 }} {{ end }} </span> </div> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 7720f3f..a83ad14 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -20,7 +20,7 @@ {{- end -}} <!-- Description is either out of the config or in front matter of a page --> {{- if or .Description $.Site.Params.description -}} - <meta name="description" content="{{ if .IsHome }}{{ $.Site.Params.description }}{{ else }}{{ .Description }}{{ end }}"> + <meta name="description" content="{{ if .IsHome }}{{ $.Site.Params.description }}{{ else }}{{ if isset .Params "description" }}{{ .Description }}{{ else }}{{ .Plain | htmlUnescape | safeHTML | truncate 140 }}{{ end }}{{ end }}"> {{- end -}} {{- template "_internal/opengraph.html" . -}} {{- template "_internal/twitter_cards.html" . -}} |