diff options
author | Jim McDonald <[email protected]> | 2019-04-05 18:11:04 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-04-05 19:11:04 +0200 |
commit | 3a62d54745e2cbfda6772390830042908d725c71 (patch) | |
tree | d039be3ac163530fa292c0bfbd50f364fad57808 /hugolib/rss_test.go | |
parent | ebab291c0e321d23b098684bacaf830a3979e310 (diff) | |
download | hugo-3a62d54745e2cbfda6772390830042908d725c71.tar.gz hugo-3a62d54745e2cbfda6772390830042908d725c71.zip |
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/rss_test.go')
-rw-r--r-- | hugolib/rss_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hugolib/rss_test.go b/hugolib/rss_test.go index 683a737c5..38f0f1eff 100644 --- a/hugolib/rss_test.go +++ b/hugolib/rss_test.go @@ -55,6 +55,9 @@ func TestRSSOutput(t *testing.T) { if c != rssLimit { t.Errorf("incorrect RSS item count: expected %d, got %d", rssLimit, c) } + + // Encoded summary + th.assertFileContent(filepath.Join("public", rssURI), "<?xml", "description", "A <em>custom</em> summary") } // Before Hugo 0.49 we set the pseudo page kind RSS on the page when output to RSS. |