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

github.com/zerostaticthemes/hugo-serif-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Austin <rob@jugglerdigital.com>2022-08-17 12:44:37 +0300
committerGitHub <noreply@github.com>2022-08-17 12:44:37 +0300
commit467bb66ed1592fa88f19e7b1f65e6070c029e689 (patch)
tree297a151940eda46c860c8029e549cfa517e12d00
parentc382aef836dda4179ba78e26f9fde0a71b2721cf (diff)
parent364dbc06c5954f614e73f0ac3df7f48e16637f82 (diff)
Merge pull request #64 from chetankothari/make-service-summary-truncation-configurable
Allow services summary truncation to be configurable
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/services/summary.html2
2 files changed, 4 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 01e7337..a75865e 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -43,6 +43,9 @@ title = "Hugo Serif Theme"
meta_twitter_creator = "@zerostaticio"
meta_og_image = "https://www.zerostatic.io/theme/hugo-serif/hugo-serif-screenshot.png"
+ [params.services]
+ summary_truncate = 120 # How many characters to include in the summary of the services before truncating
+
[params.team]
summary_large_truncate = 120 # How many characters to include in the summary of the team bios (large layout) before truncating
diff --git a/layouts/services/summary.html b/layouts/services/summary.html
index bccd45e..4e64cc7 100644
--- a/layouts/services/summary.html
+++ b/layouts/services/summary.html
@@ -3,6 +3,6 @@
<h2 class="service-title">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h2>
- <p>{{ .Content | plainify | htmlUnescape | truncate 120 "…" }}</p>
+ <p>{{ .Content | plainify | htmlUnescape | truncate (.Site.Params.services.summary_truncate | default 120 ) "…" }}</p>
</div>
</div>