diff options
author | jan <jan@kwoh.de> | 2019-08-17 15:50:16 +0300 |
---|---|---|
committer | jan <jan@kwoh.de> | 2019-08-22 14:42:43 +0300 |
commit | 2e1a9875ba31d76a31e4bb5dbffc900fe74b0914 (patch) | |
tree | 0237f3e3636671e6cb1ce98bb8c52c4f2f53fcea | |
parent | 0e33e81882fb6f494f8d91e1630bc9ab74c8f88a (diff) |
add option to show summary in main section
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | config.yaml | 2 | ||||
-rw-r--r-- | layouts/index.html | 11 |
3 files changed, 14 insertions, 1 deletions
@@ -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 }} <article> {{ partial "heading.html" . }} - {{ .Content }} + {{ if site.Params.summary }} + {{ .Summary }} + {{ if .Truncated }} + <div> + <a href="{{ .RelPermalink }}">Read Moreā¦</a> + </div> + {{ end }} + {{ else }} + {{ .Content }} + {{ end }} {{ partial "tags.html" . }} </article> {{ end }} |