-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add support for multiple contentDirs #3757
Comments
This is an initial commit to fix implement this feature, it is still missing tests. I've tested it on an example site, but I still need to write some tests. I'm pushing it now just to ask for reviews. In the [forum](https://discourse.gohugo.io/t/multiple-contentdirs/7462/4) @bep recommends to use `UnionFile`, but this solution is not using it, I am asking for reviews for this approach, but will happily implement it using `UnionFile` if it's better. Fixes gohugoio#3757
@mpcabd your code looks clean and simple enough, but, in my head, the problems with this approach are
|
Thanks for the quick review!
Where the config is
|
@mpcabd I see in your proposal that you've added a new config property I'm new to Hugo, though, so it's possible that that is against some design principles I'm not aware of, or has technical reasons preventing it from being implemented. But in general I find it better to have a flexible configuration property rather than multiple configuration properties that interplay. Assuming you do have to keep them separate properties:
|
Sorry, I looked more closely at the PR. I'm also new to Go so I'm muddling my way through it. 😄 Anyway, I think the answer to all three of my questions is that the user will see an error during site build. |
@bep I'll take care of point 1 that you mentioned, and will clarify point 2 more in code as it might not be very clear what the code is trying to do. @tylerbutler I will try to change some bits to test having Thanks both for the review, I'll come back with more changes. |
I'm a big believer in the KISS principle. I think Hugo should stick to one function, that is to transform source content (provided in as simply specified as possible structure of files) into a set of static web pages. Editing or syncing source content from multiple devices should be solved elsewhere. There are many other avenues to address this. For example:
I personally use the first two options. They both work well. The first option for when I have to get something published immediately from my mobile device, and the second for when I'm simply doing authoring on my mobile device that can be published later, via my laptop. I also think the OP's specific use case is problematic and misguided. The whole point of using git or GitHub for the contentDir is so that the source content is all under source control with full history and change tracking. |
I was planning to handle this as part of #4027 -- but that got to be a little bit too big a task. Will have to put this on hold for a little. |
Any update on it folks? I would like to leverage Hugo in a mono-repo environment. |
Seems like this was resolved with mounts: Can we close this issue? |
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. |
I am filing this issue per the suggestion from @bep here: https://discourse.gohugo.io/t/multiple-contentdirs/7462/4
Here's the scenario for supporting multiple contentDirs:
The text was updated successfully, but these errors were encountered: