summaryrefslogtreecommitdiffstats
path: root/hugolib/site_test.go
diff options
context:
space:
mode:
authorJim McDonald <Jim@mcdee.net>2019-04-05 18:11:04 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-05 19:11:04 +0200
commit3a62d54745e2cbfda6772390830042908d725c71 (patch)
treed039be3ac163530fa292c0bfbd50f364fad57808 /hugolib/site_test.go
parentebab291c0e321d23b098684bacaf830a3979e310 (diff)
hugolib: Consider summary in front matter for .Summary
Add the ability to have a `summary` page variable that overrides the auto-generated summary. Logic for obtaining summary becomes: * if summary divider is present in content, use the text above it * if summary variables is present in page metadata, use that * auto-generate summary from first _x_ words of the content Fixes #5800
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r--hugolib/site_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index 21575072d..5912abbc9 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -586,6 +586,7 @@ date = "2012-01-01"
publishdate = "2012-01-01"
my_param = "baz"
my_date = 2010-05-27T07:32:00Z
+summary = "A _custom_ summary"
categories = [ "hugo" ]
+++
Front Matter with Ordered Pages 4. This is longer content`