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 #3734

Closed
Shuenhoy opened this Issue Jul 25, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@Shuenhoy

Shuenhoy commented Jul 25, 2017

I saw the code "var SummaryLength = 70" in the hugo/helpers/content.go, however, I use Chinese and that length is too short. I Hope it can be configurable. Thanks!

@bep bep added the Hacktoberfest label Sep 22, 2017

@bmon

This comment has been minimized.

Show comment
Hide comment
@bmon

bmon Sep 28, 2017

Contributor

@bep Hi, I'd like to have a go at this issue. Any tips on where to get started?

Contributor

bmon commented Sep 28, 2017

@bep Hi, I'd like to have a go at this issue. Any tips on where to get started?

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Sep 28, 2017

Member

@bmon great! I suggest you

  • Add a new config option named summaryLength, default 70.
  • Add it as a variable in helpers.ContentSpec. There are other vars in this struct that gets their value from the config, so "follow one of them..." to see where the default config is created.
Member

bep commented Sep 28, 2017

@bmon great! I suggest you

  • Add a new config option named summaryLength, default 70.
  • Add it as a variable in helpers.ContentSpec. There are other vars in this struct that gets their value from the config, so "follow one of them..." to see where the default config is created.

bmon added a commit to bmon/hugo that referenced this issue Sep 29, 2017

Change SummaryLength to be configurable
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

bmon added a commit to bmon/hugo that referenced this issue Sep 29, 2017

Change SummaryLength to be configurable
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

@bep bep closed this in #3924 Sep 29, 2017

bep added a commit that referenced this issue Sep 29, 2017

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

brennanangel added a commit to brennanangel/hugoDocs that referenced this issue Jul 3, 2018

Include "summaryLength" config option
*Updated to include "summaryLength" configuration option from gohugoio/hugo#3734
*Took line about HTML loading in summary and updated it to clarify the user has options to show html or not instead of implying there are no options
*Fixed typos

brennanangel added a commit to brennanangel/hugoDocs that referenced this issue Sep 12, 2018

Include "summaryLength" config option
*Updated to include "summaryLength" configuration option from gohugoio/hugo#3734
*Took line about HTML loading in summary and updated it to clarify the user has options to show html or not instead of implying there are no options
*Fixed typos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment