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

Warn if template specified by "layout" in front matter does not exist #3171

Open
lpar opened this issue Mar 12, 2017 · 8 comments
Open

Warn if template specified by "layout" in front matter does not exist #3171

lpar opened this issue Mar 12, 2017 · 8 comments

Comments

@lpar
Copy link

lpar commented Mar 12, 2017

Followup to discussion on forum.

If files include a layout = value in their frontmatter, and there is no matching template, they are silently ignored.

Instead, some sort of error should be generated, or at least a warning. Something along the lines of:

No template matching layout 'foo' for file/name/here.md

This would have saved me quite a bit of debugging time.

@stale
Copy link

stale bot commented Dec 6, 2017

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.

@stale stale bot added the Stale label Dec 6, 2017
@vassudanagunta
Copy link
Contributor

#3514 would be a good place for this.

@stale
Copy link

stale bot commented Mar 7, 2018

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.

@stale stale bot added the Stale label Mar 7, 2018
@bep bep added the Keep label Mar 7, 2018
@stale stale bot removed the Stale label Mar 7, 2018
@kaushalmodi
Copy link
Contributor

I think solving this issue is critical for better site debug. Please don't let this just drop off.

@bep
Copy link
Member

bep commented Mar 7, 2018

I think this would be more useful in this area: #4481 -- I'm not totally sure about this one.

@kaushalmodi
Copy link
Contributor

Solution to that issue would be even better! May be that trace shows a warning that as the layout specified in front matter does not exist, Hugo is using the default available as per lookup order.

@gohugoio gohugoio deleted a comment from sarathsp06 May 8, 2023
@gohugoio gohugoio deleted a comment from sarathsp06 May 8, 2023
@jmooring
Copy link
Member

jmooring commented May 8, 2023

I'm not sure when this changed, but we do not "silently drop content" if the layout specified in front matter does not exist. Instead, we fallback to Hugo's defined lookup order.

@jmooring jmooring changed the title Warn about missing templates instead of silently dropping content Warn if template specified by "layout" in front matter does not exist May 8, 2023
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@moorereason @jmooring @bep @lpar @vassudanagunta @kaushalmodi and others