-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Common MetaData for multilanguage pages #757
Comments
@cord Having nearly completed an entire site translation myself using Grav, I think this is an excellent idea. |
Due to the performance enhancing decisions we made with the design of the multi-language support in Grav, this is really not possible. This is because Grav only knows about one language at a time, there's no way for Grav to look in 'parent' languages and 'merge' things. Grav will fall back through the supported languages if a particular language file is not found, however, this really not the same because it only happens during the initial caching phase, and once a file is found, it's processed. So ultimately this concern is one of performance. Having every single page parsing every other language file and merging is going to cause huge performance problems. I really can't see how this could be done efficiently. If you have any ideas i'm open to listen to them. |
Hi Andy, In my view grav would "only" need to look for default.meta.yaml and - if exists - read it and create the meta data structure before loading the language specific .md file which would then complete the meta data or eventually override settings. There would be one default.meta.yaml file per page folder. |
I agree with cord. Duplication of (meta) data is error-prone. A single meta data yaml would only have a minor performance penalty. |
Ok, I created a PR for a solution to this. I made it a generic IMPORTANT Please read my comments about the caveats of this: #775 (comment)
is my test case. |
Anyway, performance-wise this extra check added 3ms to my 100page test site (before caching). |
Closing as the PR #775 was merged |
working with multiple languages I find myself copying common meta-data / header settings between the language variants.
Would be great to have a solution, where there is first loaded a common meta data file, which then might be overwritten by the actual language files, e.g.
The text was updated successfully, but these errors were encountered: