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
Chops off trailing .Content in one multioutput setup #4706
Comments
I wish I could understand the changes in this commit (288c396) that's the only functional difference between 0.40 and 0.40.1. But that's what introduced this issue. |
For the future, please keep bug titles in a neutral tone. Using movie style titles to draw attention really don't work. |
I needed to make a point that this was serious; caused content loss. It's not a big deal for my test site, but could cause a problem with professional sites. I am not sure what was "movie title like" in the old title.. I mentioned key points of information:
|
I cannot see in the example above that the |
No, the trailing portion of the If you look at the Markdown source: |----------------------------------|--------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `<ORG_FILE_DIR>/bar/baz/foo.png` | `<HUGO_BASE_DIR>/content/<SECTION>/<BUNDLE>/bar/baz/foo.png` | Even if the **outside** path does not have `/static/`, it is still inside the same dir as the Org file, so the directory structure is preserved. |
See [this other test](/images-in-content/page-bundle-images-in-same-dir/) for an example. you will see that the HTML contains the content only up to "it is still inside the same dir as the Org file,": <td>Even if the <strong>outside</strong> path does not have <code>/static/</code>, it is still inside the same dir as the Org file, This part from the Markdown file (towards the end) is missing in the HTML: so the directory structure is preserved. |
See [this other test](/images-in-content/page-bundle-images-in-same-dir/) for an example. Note the "good HTML" snippet generated using Hugo 0.40 has this portion: so the directory structure is preserved.</td>
</tr>
</tbody>
</table>
<p>See <a href="https://ox-hugo.scripter.co/test/images-in-content/page-bundle-images-in-same-dir/">this other test</a> for an example.</p> which is absent in the live example. As the table-closing is chopped off, the "Resources" heading which should be a separate |
Also, I don't understand how to build the above project (seems to need Emacs and vc-git etc). |
Sorry, I did an edit of the steps few minutes back.. try:
|
Yes, I can reproduce it on your site. I understand the what, but not the why. I will investigate, and issue a patch release tomorrow. Thanks for the report. And re. the issue title, a movie title is of type "Scary movie in theatres on May 8th" Issue titles should be short and tell what it is. The when and how serious etc. may belong in the body text, but it should be obvious from the what. I see too many drama titles of type "Hugo 0.x seriously blew up my site." A bug is super-serious to the issue reporter, I understand that, but ... |
Understood.
Thanks! |
Looks like this issue is on a lot more pages than I thought; surprised why no one else spotted this. Another example: Note that all content after "It is necessary to set the Hugo site config variable" below is lost: **It is necessary to set the Hugo site config variable
`pygmentsCodeFences` to `true` for syntax highlighting to work for
fenced code blocks.**
[^fn:1]: Even if the user has set the `HUGO_CODE_FENCE` value to `t` (via variable, keyword or subtree property), the Hugo `highlight` shortcode will be used automatically instead of code fences if either (i) the user has chosen to either show the line numbers, or (ii) has chosen to highlight lines of code (See the `ox-hugo` documentation on [Source Blocks](https://ox-hugo.scripter.co/doc/source-blocks)). Here's the truncated <p><strong>It is necessary to set the Hugo site config variable
<
<hr />
<a id="debug"></a> Something special about me using |
Your site does not represent the average Hugo site. If you could take the PR above for a spin and tell me if that fixes this issue. |
I confirm that to fix this issue (I have now rebuilt my site using the fix in the PR. The only way to see the bug is to now use Hugo v0.40.1, v0.40.2 and generate the site locally). Thanks!
OK. Not sure what would represent an average Hugo site. The only thing different I am doing in this site is print out all the debug info and implement search. Apart from that, it's pretty bare bones. I don't even use any shortcodes other than may be In any case, I'd like to understand how my site turned out to be a corner case (if so). Hopefully looking at the tests you add helps me understand that. Also note that this issue showed up only on doing |
I will look at this more tomorrow. This is a bug, but I suspect that it relates to your not very bare bones page output definitions: ▶ find content -name "*.md" | xargs grep outputs
content/search.md:outputs = ["html", "json"]
content/posts/output-html-and-json.md:outputs = ["html", "json"]
content/posts/output-html-and-json.md:tags = ["outputs", "json"]
content/posts/output-html-and-json.md:template lookup hierarchy for the JSON outputs to be created.
content/posts/output-empty.md:title = "Setting empty outputs is fine"
content/posts/output-empty.md:tags = ["outputs", "empty"]
content/posts/output-empty.md:will not set the `outputs` variable in the front-matter at all. So
content/posts/keyword-collection.md:outputs = ["html", "json"]
content/posts/keyword-collection.md:- [X] `#+hugo_outputs` |
Aha, to separate out the matches with "outputs" in that: Files with
|
No, that was just me being lazy with the grep. |
There have been one report of a site with truncated `.Content` after the Hugo `0.41` release. This commit fixes this so that race should not be possible anymore. It also adds a stress test with focus on content rendering and multiple output formats. Fixes gohugoio#4706
There have been one report of a site with truncated `.Content` after the Hugo `0.41` release. This commit fixes this so that race should not be possible anymore. It also adds a stress test with focus on content rendering and multiple output formats. Fixes gohugoio#4706
Hi @bep! Sorry for the interruption, but caught a possible typo in your commit log:
I guess you meant to say |
There have been one report of a site with truncated `.Content` after the Hugo `0.40.1` release. This commit fixes this so that race should not be possible anymore. It also adds a stress test with focus on content rendering and multiple output formats. Fixes gohugoio#4706
There have been one report of a site with truncated `.Content` after the Hugo `0.40.1` release. This commit fixes this so that race should not be possible anymore. It also adds a stress test with focus on content rendering and multiple output formats. Fixes gohugoio#4706
Just a quick note. I will create a patch release with this tomorrow. Also note that even if the fix was semi-obvious reading the code, I have not been able to reproduce this outside of the synthetic test site from @kaushalmodi -- I have tested the output before/after this patch for a set of sites, including the pretty big Kubernetes site with 1000+ long content pages in both English and Chinese, with exact same result. |
Thanks!
That definitely makes me feel special 😁. But was the issue caused just because of those Note that my test site is testing every Hugo front-matter, for the sake of my |
@kaushalmodi I tried to pin-point the exact error case, but I got tired. The tests in this area should be greatly improved as a result of this, and that is great. |
There have been one report of a site with truncated `.Content` after the Hugo `0.40.1` release. This commit fixes this so that race should not be possible anymore. It also adds a stress test with focus on content rendering and multiple output formats. Fixes gohugoio#4706
No problem. Thank you for the prompt fix, and in addition adding more test cases! |
There have been one report of a site with truncated `.Content` after the Hugo `0.40.1` release. This commit fixes this so that race should not be possible anymore. It also adds a stress test with focus on content rendering and multiple output formats. Fixes gohugoio#4706
There have been one report of a site with truncated `.Content` after the Hugo `0.40.1` release. This commit fixes this so that race should not be possible anymore. It also adds a stress test with focus on content rendering and multiple output formats. Fixes #4706
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. |
Hello,
I realized that Hugo 0.40.1 introduced a serious regression.
It chops off some of the trailing
.Content
!hugo server
.public/
using thehugo
command.Bug example
Live example of this bug(not live any more) (Search for "Resources" to get to the point of truncated.Content
) | Markdown of that pageNotice the malformed HTML:
This is what I have in the template:
And this is the HTML around the part where the
.Content
ends:Notice that the ending portion of the table got truncated!
If I roll back to Hugo 0.40, this bug is gone. See that that table is generated in entirety:
How to recreate this issue
./public/bundles/page-bundle-a/index.html
.I have yet been unable to create a smaller reproducible version of this bug. But it is 100% reproducible using the above steps.
The text was updated successfully, but these errors were encountered: