mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
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
This commit is contained in:
parent
ebab291c0e
commit
3a62d54745
8 changed files with 115 additions and 15 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue