summaryLenght is broken for me, use truncate for uniform summaries

master
Quentin Duchemin 2021-05-25 00:25:58 +02:00
parent aca1d1d256
commit e51a047749
Signed by: Chosto
GPG Key ID: 0547178FEEDE7D6B
3 changed files with 16 additions and 10 deletions

View File

@ -8,7 +8,6 @@ languageCode: fr-fr
languageName: Français languageName: Français
watch: true watch: true
paginate: 5 paginate: 5
summaryLength: 50
permalinks: permalinks:
# All pages under posts section will have this link structure # All pages under posts section will have this link structure

View File

@ -32,10 +32,17 @@
</a> </a>
</div> </div>
<hr style="margin: 1rem 0;"> <hr style="margin: 1rem 0;">
{{ .Summary }} {{ .Content | plainify | safeHTML | truncate 300 "..." }}
</div> </div>
<footer class="card-footer"> <footer class="card-footer has-text-centered">
<div class="is-size-7 has-text-centered card-footer-item"> {{ with .Params.categories }}
<div class="card-footer-item is-centered is-rounded">
{{ range . }}
<span class="tag mx-1"><a href="{{ "categories" | absURL }}/{{ . | urlize }}">{{ . }}</a></span>
{{ end }}
</div>
{{ end }}
<div class="card-footer-item is-size-7">
<time datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}"> <time datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
{{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }} {{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }}
</time>&nbsp;&nbsp;{{ .FuzzyWordCount }} mots </time>&nbsp;&nbsp;{{ .FuzzyWordCount }} mots

View File

@ -13,7 +13,7 @@
</div> </div>
{{ end }} {{ end }}
<!-- Words and date stuff makes sens only for blog posts, not other pages --> <!-- Words and date stuff makes sens only for blog posts, not other pages -->
{{ if (and .IsPage (eq .FirstSection "posts"))}} {{ if (and .IsPage (eq .FirstSection.Section "posts"))}}
<aside> <aside>
<div> <div>
<section> <section>