Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/de-souza/hugo-flex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjan <jan@kwoh.de>2019-08-17 15:50:16 +0300
committerjan <jan@kwoh.de>2019-08-22 14:42:43 +0300
commit2e1a9875ba31d76a31e4bb5dbffc900fe74b0914 (patch)
tree0237f3e3636671e6cb1ce98bb8c52c4f2f53fcea
parent0e33e81882fb6f494f8d91e1630bc9ab74c8f88a (diff)
add option to show summary in main section
-rw-r--r--README.md2
-rw-r--r--config.yaml2
-rw-r--r--layouts/index.html11
3 files changed, 14 insertions, 1 deletions
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 }}
<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 }}