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
watch: true
paginate: 5
summaryLength: 50
permalinks:
# All pages under posts section will have this link structure

View File

@ -32,13 +32,20 @@
</a>
</div>
<hr style="margin: 1rem 0;">
{{ .Summary }}
{{ .Content | plainify | safeHTML | truncate 300 "..." }}
</div>
<footer class="card-footer">
<div class="is-size-7 has-text-centered card-footer-item">
<time datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
{{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }}
</time>&nbsp;&nbsp;{{ .FuzzyWordCount }} mots
</div>
</footer>
<footer class="card-footer has-text-centered">
{{ 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 }}">
{{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }}
</time>&nbsp;&nbsp;{{ .FuzzyWordCount }} mots
</div>
</footer>
</div>

View File

@ -13,7 +13,7 @@
</div>
{{ end }}
<!-- 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>
<div>
<section>