hugo-PaperMod icon indicating copy to clipboard operation
hugo-PaperMod copied to clipboard

render short summaries into HTML

Open vindex10 opened this issue 1 year ago • 1 comments
trafficstars

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:

  1. If .Page.params.summary is defined in the page frontMatter -> render this summary
  2. Else if, .Summary was not truncated (.Truncated is false) -> render the page .Contents for summary.
  3. 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.

image image image image

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:

image

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.

vindex10 avatar Jan 26 '24 18:01 vindex10

Quality Gate Passed 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

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Jan 26 '24 18:01 sonarqubecloud[bot]

This make the card more confusing for the user. It is better the way it is now.

adityatelange avatar Mar 08 '24 05:03 adityatelange