Change SummaryLength to be configurable (#3924)

Move SummaryLength into the ContentSpec struct and refactor the
relevant summary functions to be methods of ContentSpec. The new
summaryLength struct member is configurable by the summaryLength config
value, and the default remains 70. Also updates hugolib/page to use the
refactored methods.

Resolves #3734
This commit is contained in:
Brendan Roy
2017-09-29 17:04:55 +10:00
committed by Bjørn Erik Pedersen
parent 2818878994
commit 8717a60cc0
5 changed files with 32 additions and 21 deletions

View File

@@ -135,6 +135,7 @@ func loadDefaultSettingsFor(v *viper.Viper) error {
v.SetDefault("newContentEditor", "")
v.SetDefault("paginate", 10)
v.SetDefault("paginatePath", "page")
v.SetDefault("summaryLength", 70)
v.SetDefault("blackfriday", c.NewBlackfriday())
v.SetDefault("rSSUri", "index.xml")
v.SetDefault("rssLimit", -1)