Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SummayLength configurable #3735

Closed
wants to merge 10 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@Shuenhoy
Copy link

Shuenhoy commented Jul 25, 2017

No description provided.

@Shuenhoy Shuenhoy requested a review from bep as a code owner Jul 25, 2017

@CLAassistant

This comment has been minimized.

Copy link

CLAassistant commented Jul 25, 2017

CLA assistant check
All committers have signed the CLA.

@Shuenhoy Shuenhoy closed this Jul 25, 2017

@Shuenhoy

This comment has been minimized.

Copy link
Author

Shuenhoy commented Jul 25, 2017

It seems that my code is out of date

@Shuenhoy Shuenhoy reopened this Jul 25, 2017

@@ -37,7 +37,7 @@ import (
)

// SummaryLength is the length of the summary that Hugo extracts from a content.
var SummaryLength = 70
var SummaryLength = 200

This comment has been minimized.

@bep

bep Jul 25, 2017

Member

Don't change the default value. That will break many, many sites.

This comment has been minimized.

@bep

bep Jul 25, 2017

Member

As this is moved to a config variable, this variable should be removed.

@@ -132,4 +133,5 @@ func loadDefaultSettingsFor(v *viper.Viper) {
v.SetDefault("enableGitInfo", false)
v.SetDefault("ignoreFiles", make([]string, 0))
v.SetDefault("disableAliases", false)
v.SetDefault("SummaryLength", 200)

This comment has been minimized.

@bep

bep Jul 25, 2017

Member

Follow the pattern ans start with lower char: SummaryLength > summaryLength

This comment has been minimized.

@bep

bep Jul 25, 2017

Member

As noted above: The default above should remain at 70 (changing that will break many many sites).

@@ -611,9 +611,9 @@ func (p *Page) setAutoSummary() error {
var summary string
var truncated bool
if p.isCJKLanguage {
summary, truncated = helpers.TruncateWordsByRune(p.PlainWords(), helpers.SummaryLength)
summary, truncated = helpers.TruncateWordsByRune(p.PlainWords() , p.s.Cfg.GetInt("SummaryLength"))

This comment has been minimized.

@bep

bep Jul 25, 2017

Member

summaryLength

Shuenhoy added some commits Jul 25, 2017

@bep

bep approved these changes Jul 25, 2017

@bep

This comment has been minimized.

Copy link
Member

bep commented Jul 25, 2017

And this needs a line somewhere in the documentation (just add it to this PR).

@gohugoio gohugoio deleted a comment from CLAassistant Jul 27, 2017

@moorereason

This comment has been minimized.

Copy link
Contributor

moorereason commented Sep 30, 2017

Replaced by #3924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.