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 from
Closed

Conversation

Shuenhoy
Copy link

No description provided.

@Shuenhoy Shuenhoy requested a review from bep as a code owner July 25, 2017 01:51
@CLAassistant
Copy link

CLAassistant commented Jul 25, 2017

CLA assistant check
All committers have signed the CLA.

@Shuenhoy Shuenhoy closed this Jul 25, 2017
@Shuenhoy
Copy link
Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

hugolib/page.go Outdated
@@ -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"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

summaryLength

@bep
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
Copy link
Contributor

Replaced by #3924

@github-actions
Copy link

github-actions bot commented Feb 9, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants