From 2e1a9875ba31d76a31e4bb5dbffc900fe74b0914 Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 17 Aug 2019 14:50:16 +0200 Subject: add option to show summary in main section --- README.md | 2 ++ config.yaml | 2 ++ layouts/index.html | 11 ++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31273ad..9978a5e 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ Configuration options may be copied and modified from the theme defaults: ```yaml params: + mainSections: posts # Main content folder + summary: false # Display main content as summary color: teal # Any color in CSS syntax width: 42rem # Any length in CSS syntax footer: Except where otherwise noted, content on this site is licensed under diff --git a/config.yaml b/config.yaml index d707cd0..bd5447d 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,6 @@ params: + mainSections: posts # Main content folder + summary: false # Display main content as summary color: teal # Any color in CSS syntax width: 42rem # Any length in CSS syntax footer: Except where otherwise noted, content on this site is licensed under diff --git a/layouts/index.html b/layouts/index.html index f8397df..b21e33a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -19,7 +19,16 @@ {{ range $paginator.Pages }}
{{ partial "heading.html" . }} - {{ .Content }} + {{ if site.Params.summary }} + {{ .Summary }} + {{ if .Truncated }} +
+ Read Moreā€¦ +
+ {{ end }} + {{ else }} + {{ .Content }} + {{ end }} {{ partial "tags.html" . }}
{{ end }} -- cgit v1.2.3