Show '…' after summary when it is truncated #374
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will show
…
after summary text if it is truncated.I think I should provide option for site owner what character to display instead of
…
, but I can't decide what config name it should have. I don't know if I can use Hugo's variable/param in SCSS style neither.If we can use Hugo variable in SCSS, the config would be put under
params.hb.blog.
, butsummary-truncation-indicator
doesn't seem to be nice or intuitive word for describing this.Currently, it should be overridden by custom style in
index.scss
like this:If we can't use Hugo's param, telling people about modifying
index.scss
like that would be required.Not that related to this PR, but
hasCJKLanguage
is broken in Hugo.I think we should suggest people not to set
hasCJKLanguage
totrue
even though their site is written with CJK language.I found this problem while making my customization (and PR).
They claim
hasCJKLanguage
asbut it doesn't.
.Summary
returned less words than70
words/characters which is default value ofsummaryLength
.Turning it off returned much longer, consist length of summary text.
It also didn't processed some characters.
I found that there is weird
&
character at the end of summary text. According to content of that post, it should be"
instead. I think"
was initially"
, but was truncated, only lefting&
.This is bug of Hugo, not HB Framework. But I think it would be worthy to tell people using HB Framework that
hasCJKLanguage
will cause unexpected behavior, contrary to what Hugo Official Documentation says.At least, with that suggestion, they won't experience same problem that I had.