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

github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorg0hl1n <g0hl1n@users.noreply.github.com>2021-08-02 02:10:49 +0300
committerGitHub <noreply@github.com>2021-08-02 02:10:49 +0300
commitabd457f0d0199243eedbbb985df0d51608f6d45e (patch)
tree3b0539da2b13e664b14cc4d9ec1ebaf74219ca93
parente265efc6bf6c290bd46c545c98f5ad892fb06857 (diff)
Add recent posts parameter to hide summary (#283)
Introduce a recent_posts.hide_summary flag to not show the contents summary in the recent posts section. Signed-off-by: Richard Leitner <dev@bubus.at>
-rw-r--r--README.md3
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/recent_posts.html2
3 files changed, 5 insertions, 1 deletions
diff --git a/README.md b/README.md
index cf9c14e..d1ff751 100644
--- a/README.md
+++ b/README.md
@@ -400,7 +400,7 @@ Then, you can enable the section in the configuration file.
#### Recent posts
-The recent posts sections shows the four latest published blog posts, with their featured image and a summary. It defaults to show recent posts from all [main sections](https://gohugo.io/functions/where/#mainsections). This is either the section with the most posts or can be set explicitly in the configuration file (see linked docs).
+The recent posts sections shows the four latest published blog posts, with their featured image and an optional summary. It defaults to show recent posts from all [main sections](https://gohugo.io/functions/where/#mainsections). This is either the section with the most posts or can be set explicitly in the configuration file (see linked docs).
You can enable it in the configuration file.
@@ -409,6 +409,7 @@ You can enable it in the configuration file.
enable = true
title = "From our blog"
subtitle = "Pellen
+ hide_summary = false
```
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 34ca6cb..c4fda7a 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -198,3 +198,4 @@ paginate = 10
enable = true
title = "From our blog"
subtitle = "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo."
+ hide_summary = false
diff --git a/layouts/partials/recent_posts.html b/layouts/partials/recent_posts.html
index b482966..f16b272 100644
--- a/layouts/partials/recent_posts.html
+++ b/layouts/partials/recent_posts.html
@@ -43,10 +43,12 @@
{{ end }}
{{ i18n "publishedOn" }} {{ .Date.Format .Site.Params.date_format }}
</p>
+ {{ if not .Site.Params.recent_posts.hide_summary }}
<p class="intro">{{ .Summary }}</p>
<p class="read-more">
<a href="{{ .Permalink }}" class="btn btn-template-main">{{ i18n "continueReading" }}</a>
</p>
+ {{ end }}
</div>
</div>
<!-- /.box-image-text -->