Skip to content
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

html content does not include summary, whereas md content does #6686

Closed
Dieterbe opened this issue Dec 30, 2019 · 9 comments
Closed

html content does not include summary, whereas md content does #6686

Dieterbe opened this issue Dec 30, 2019 · 9 comments

Comments

@Dieterbe
Copy link

Dieterbe commented Dec 30, 2019

What version of Hugo are you using (hugo version)?

current git build (v0.62.0-3-gaa4ccb8a)

$ hugo version
Hugo Static Site Generator v0.63.0-DEV linux/amd64 BuildDate: unknown

Does this issue reproduce with the latest release?

Yes, tested with 0.62.0 official release as well.

can easily be reproduced like so:

mkdir hugo-test
cd hugo-test
hugo new site quickstart && cd quickstart
mkdir themes && cd themes && git clone https://github.com/yanlinlin82/simple-style.git && cd ..
echo 'theme = "simple-style"' >> config.toml
mkdir content/post
cat <<EOF > content/post/mdpost.md
---
title: "Mdpost"
date: 2019-12-30T15:21:57+01:00
draft: false
---
summary
<!--more-->
content
EOF
cat <<EOF > content/post/htmlpost.html
---
title: "Htmlpost"
date: 2019-12-30T15:21:15+01:00
draft: false
---
summary
<!--more-->
content
EOF
hugo server

when you load the html post and the md post in your browser, you can see that the html post does not include the summary, but the markdown does.

@yanlinlin82
Copy link

Thank you for reporting this. I will check if this is a problem in my theme ('simple-style').

@Dieterbe
Copy link
Author

Dieterbe commented Jan 3, 2020

no, the problem is the {{.Content}} variable, sometimes it contains the summary part of the content, sometimes it only contains the part of the content after the summary divider.

@yanlinlin82
Copy link

I see. thanks!

@stale
Copy link

stale bot commented May 2, 2020

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.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@jmooring
Copy link
Member

Please re-open.

@ptgott
Copy link
Contributor

ptgott commented Jan 25, 2022

Just a note that if we do want to change this behavior, the place to look is in this if block or, if #9423 is merged, in this function.

As it stands now, there is an integration test assertion that HTML content must not include the main content, so the solution might be to document this discrepancy.

@jmooring jmooring added the Bug label Apr 29, 2024
@bep bep added this to the v0.131.0 milestone Jul 30, 2024
@bep bep modified the milestones: v0.131.0, v0.133.0 Aug 9, 2024
@bep bep modified the milestones: v0.133.0, Unscheduled Aug 29, 2024
@jmooring
Copy link
Member

This was resolved in v0.134.0.

@Dieterbe
Copy link
Author

confirmed. thank you!

@jmooring jmooring removed the Keep label Sep 19, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants