-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Manual content summaries insert with <p>
tag
#8910
Comments
When you render
The table above was updated on 3 Sep 2024 to reflect changes in v0.134.0. As a template author, you have no way of knowing if
You can determine if the summary was defined in front matter, and access its raw value, with Related:
Somewhat related, applicable to HTML content pages:
Somewhat related (embedded templates): Example site with an example of each summary method: git clone --single-branch -b hugo-github-issue-8910 https://github.com/jmooring/hugo-testing hugo-github-issue-8910
cd hugo-github-issue-8910
hugo server |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
@bep @jmooring What would you think the solution should be? Looks like some choices are:
|
I think we all can agree that this is unexpected behavior. I would have never guessed that the I can also understand that there are use-cases for a summary in form of raw text. Therefore I would prefer @ptgott 3rd suggestion most. |
I'm using this combination of filters to retrieve the RAW Summary:
|
The unexpected behavior still exists as of now. |
Closing in favor of #11440. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
While designing my own theme, I came across a curious issue:
When using the
{{ .Summary }}
page variable to manually generate a summary in combination with the<!--more-->
tag in a post, Hugo inserts the summary wrapped with a<p>
tag.Here's what I'm expecting:
When using the
{{ .Summary }}
page variable to automatically generate summaries, Hugo simply inserts the summary text in the template - not wrapped with any HTML tags.I am using the latest release. So, yes, this issue is reproducible in the latest release.
summary.html
template fileReproducible erroneous behavior
See this example with manual summary generation:
test.md
Result
Expected behavior
Now compare this to what I'm expecting:
test.md
Result
The text was updated successfully, but these errors were encountered: