Open
Conversation
Hugo's automatic and manual summaries (see https://gohugo.io/content-management/summaries/#manual-summary) are wrapped in a paragraph. Nested paragraphs are invalid, so when the browser renders the summary, it will be placed _after_ the `.line-summary` paragraph, causing the summary to be styled as normal text. Using a `div` for the summary results in correct styling of these summaries, while keeping the styling for summaries specified in the frontmatter intact.
There was a problem hiding this comment.
Pull request overview
This PR adjusts the post list entry template to avoid invalid nested paragraphs when rendering Hugo automatic/manual summaries, ensuring .line-summary styling applies correctly.
Changes:
- Replace the
.line-summarywrapper element from<p>to<div>to avoid nested<p>invalid HTML in list summaries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| {{ if .Site.Params.listSummaries }} | ||
| <p class="line-summary"> {{ .Summary }} </p> | ||
| <div class="line-summary"> {{ .Summary }} </div> |
There was a problem hiding this comment.
Indentation within the {{ if .Site.Params.listSummaries }} block is inconsistent with the surrounding template (e.g., the earlier showListDate block). Consider indenting the <div class="line-summary"> line one level deeper to match the nesting and improve readability.
Suggested change
| <div class="line-summary"> {{ .Summary }} </div> | |
| <div class="line-summary"> {{ .Summary }} </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hugo's automatic and manual summaries (see https://gohugo.io/content-management/summaries/#manual-summary) are wrapped in a paragraph. Nested paragraphs are invalid, so when the browser renders the summary, it will be placed after the
.line-summaryparagraph, causing the summary to be styled as normal text. Using adivfor the summary results in correct styling of these summaries, while keeping the styling for summaries specified in the frontmatter intact.