diff options
| -rw-r--r-- | layouts/home.html | 8 | ||||
| -rw-r--r-- | layouts/section.html | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/layouts/home.html b/layouts/home.html index cffb6bc..f285b41 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -12,7 +12,13 @@ {{ range first 6 $articles }} {{ $type := .Params.type }} {{ if not $type }}{{ $type = "article" }}{{ end }} - {{ $data := dict "title" .Title "type" $type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" .Params.featured }} + + {{ $excerpt := .Params.excerpt }} + {{ if not $excerpt }} + {{ $excerpt = .Summary | plainify | truncate 150 }} + {{ end }} + + {{ $data := dict "title" .Title "type" $type "description" $excerpt "date" .Date "url" .RelPermalink "image" .Params.image "featured" .Params.featured }} {{ partial "post-card.html" $data }} {{ end }} {{ end }} diff --git a/layouts/section.html b/layouts/section.html index 8b938f3..b9f0646 100644 --- a/layouts/section.html +++ b/layouts/section.html @@ -14,7 +14,12 @@ <div class="feed-list" id="articles-feed"> {{ range .Pages.ByDate.Reverse }} - {{ $data := dict "title" .Title "type" .Params.type "description" .Summary "date" .Date "url" .RelPermalink "image" .Params.image "featured" false }} + {{ $excerpt := .Params.excerpt }} + {{ if not $excerpt }} + {{ $excerpt = .Summary | plainify | truncate 150 }} + {{ end }} + + {{ $data := dict "title" .Title "type" .Params.type "description" $excerpt "date" .Date "url" .RelPermalink "image" .Params.image "featured" false }} {{ partial "post-card.html" $data }} {{ end }} </div> |
