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

Prevent panic when creating new content if also created by content adapter #12504

Open
jmooring opened this issue May 16, 2024 · 2 comments
Open
Labels
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented May 16, 2024

These are all minor, and should probably be separated into individual issues at some point, but for now...

1) If a content adapter creates p1, attempting to create p1.md with hugo new causes a panic.

2) If p1.md exists, and a content adapter creates p1, the content adapter wins. It seems to me it should be the other way around; p1.md should override the content adapter. For example, a module provides content, and you need to override one of the pages provided by the module. See comments below.

3) If p1.md exists, and a content adapter creates p1, the --printPathWarnings flag does not report a page collision. See comments below.

@bep bep removed the NeedsTriage label May 16, 2024
@bep bep added this to the v0.127.0 milestone May 16, 2024
@bep
Copy link
Member

bep commented May 16, 2024

  1. The behaviour here is undefined; if you see a winner here, that is by chance. We sort the directories before we process them, but p1.md and _content.gotmpl is processed in separate Go routines, so who's the winner of p1.md and p1 from some _content.gotmpl is undefined.
  2. I think there's an existing issue for this.

@jmooring
Copy link
Member Author

jmooring commented May 16, 2024

if you see a winner here, that is by chance

Understood. I have added a "page collisions" section to the documentation:
https://gohugo.io/content-management/content-adapters/#page-collisions

@jmooring jmooring changed the title Miscellaneous improvements to content adapters Prevent panic when creating new content if also created by content adapter May 16, 2024
@bep bep added Bug and removed Proposal labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants