hugo-PaperMod
hugo-PaperMod copied to clipboard
render short summaries into HTML
What does this PR change? What problem does it solve?
It introduces a new config option: onlyRenderedShortSummaries: true/false.
When set to true, it renders the summaries in the entry lists. See example on the screenshots.
.Summar by default strips html, so the logic is the following:
- If
.Page.params.summaryis defined in the page frontMatter -> render this summary - Else if,
.Summarywas not truncated (.Truncatedis false) -> render the page.Contentsfor summary. - Else, do not show summary at all.
Which means, for the long posts, if summary has to be truncated AND it was not provided in the frontMatter, it will not be shown.
additionally, due to rendered HTML (with links) can confusingly lead to the post instead of the link url, this PR brings the entry summary on top of the link, when "render small summaries" is turned on.
this is how hover on "black" link looks like in this PR:
It should be noted, that this PR is blocked by another pull request, which allows parametrizing theme styles: https://github.com/adityatelange/hugo-PaperMod/pull/1399
... and should be rebased when the 1399 is merged.
Was the change discussed in an issue or in the Discussions before?
no
PR Checklist
- [ ] This change adds/updates translations and I have used the template present here.
- [x] I have enabled maintainer edits for this PR.
- [x] I have verified that the code works as described/as intended.
- [ ] This change adds a Social Icon which has a permissive license to use it.
- [x] This change does not include any CDN resources/links.
- [x] This change does not include any unrelated scripts such as bash and python scripts.
- [ ] This change updates the overridden internal templates from HUGO's repository.
Quality Gate passed
Kudos, no new issues were introduced!
0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
This make the card more confusing for the user. It is better the way it is now.