hugolib: Consider summary in front matter for .Summary
authorJim McDonald <Jim@mcdee.net>
Fri, 5 Apr 2019 17:11:04 +0000 (18:11 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 5 Apr 2019 17:11:04 +0000 (19:11 +0200)
commit3a62d54745e2cbfda6772390830042908d725c71
treed039be3ac163530fa292c0bfbd50f364fad57808
parentebab291c0e321d23b098684bacaf830a3979e310
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
helpers/content.go
helpers/content_test.go
hugolib/page__meta.go
hugolib/page__per_output.go
hugolib/page_test.go
hugolib/rss_test.go
hugolib/site_test.go
tpl/transform/transform.go