-
Notifications
You must be signed in to change notification settings - Fork 954
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
Merge default data language data in config.toml #1918
Comments
Hi @Keats and @peterkelm, just a heads up that I've since updated papaya to declare the taxonomies in both the global section and Is that the right way to go about declaring the taxonomies for multilingual sites? |
It's probably better to keep it at the root level for now since you can end up missing data otherwise. This issue is a good one if someone wants a pretty simple issue to contribute. |
With
Version |
I'd be happy to give this a shot! Regarding the desired behavior: if the same variable is specified at the base section and under [language.DEFAULT_LANGUAGE], do we want base to override the latter or the other way around? |
That's a good question. I think it should probably error since that's a mistake. |
Yeah, that sounds reasonable. I think I have some idea of that might work. I haven't tried any fix yet, but I think this is do-able for me. Could you put me as assignee on this issue? |
There are some fields of
Similar manners exist for handling these more complex types:
I'm leaning toward the simple approach for all of these fields and stopping the user at that point, since they should probably specify their Also, I suspect that if we implement the functionality of Zola raising an error during merge conflict, it will break a substantial amount of multilingual sites where the user was not fully aware of this behavior when writing the config. What do you say about simply raising a warning at merge conflict to begin with, merging by giving the language section variables priority over the base (since that's how it's been working so far), and see how that works out? |
Thinking about it more, we should probably have a warning either way if the section for the default language is defined and some fields are defined at the root of the config.toml.
We can do that yes. Although since Zola releases are not super frequent, I think it might enough to document this change in the changelog and keep the error. |
Yeah, I'll go ahead with the approach that you're suggesting. I've started writing the first test, so hopefully I'll have something up for review in the coming days. |
…using papaya theme What: Copies the taxnomies config to all languages: Why: Fixes this error: ``` [I] norman@cyan ~/code/blog (main) ❯ zola build Building site... Error: Failed to build the site Error: Page `/Users/norman/code/blog/content/projects/project-1/index.md` has taxonomy `categories` which is not defined in config.toml ``` Discussion: https://zola.discourse.group/t/zola-0-15-3-issue-not-all-pages-sections-have-their-language-and-translations-set-properly/1385 Open issue: getzola/zola#1918
Right now we can put the data in 2 different places for the default language in config.toml: the base file and
language.DEFAULT_LANGUAGE
. Those are not currently merged and zola will just takelanguage.DEFAULT_LANGUAGE
data if present, resulting in missing data and hard to diagnose error. See https://github.com/justint/papaya/blob/44be3a1b39a8bad5b33e55e8f6de8953d0ca2e20/config.toml for an exampleThe text was updated successfully, but these errors were encountered: