hugolib: include content file path in error messages#14688
hugolib: include content file path in error messages#14688xingzihai wants to merge 1 commit intogohugoio:masterfrom
Conversation
When a template render fails, include the page path in the error message to help users identify which content file caused the issue. Closes gohugoio#14607
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
|
Problem
When Hugo encounters an error during content file rendering, the error message does not include which content file caused the issue, making it difficult for users to identify the problematic file.
Solution
Modified the renderForTemplate function in hugolib/site.go to include the page path in error messages when a template render fails for a page.
Changes
Example
Before:
render of "list" failed: template: ...
After:
render of "list" failed for "content/posts/my-post.md": template: ...
Closes #14607