-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Layout metadata should be combined to the document's #458
Comments
Agreed, I hit this issue recently. Should the docoument meta data take preference of the layout? So bottom takes preference? |
I think so yes. There is a sort of chain. It would be too complicated to combine the data I guess. |
I'll add it to the todo. The question now becomes when in the processing order should this occur? During rendering or prior? For example, we have to prevent the layout's |
I also encountered this and found that it didn't behave the way I expected.
This is what I expected, yes. (I can see from his example why @ndastur would like the values to be combined, but I don't think I'd reasonably expect that to happen.) |
Thanks for that. Does this sound good? It is done during the contextualize process, and done in a bottom first (document first) and top last (layout last) merge style. That way we wouldn't be over-writing any meta data properties. |
I... don't think I can parse what you're saying? Perhaps an example? This is what I'd expect (please note: I'm basically a Docpad newb):
Resulting
I would expect the same if the content line were in the layout rather than in the document. So, merging values, with document values having precedence over layout values, and layouts closer to the document having precedence over deeper ancestor layouts. (For background: I'm in the midst of making an i18n-happy site and using https://github.com/OuiShare/ouisharefest as a reference. So the actual page content is in a layout and the documents are just shells that specify what language they should be in. So I want to be able to specify the title -- or, specifically, the title-translation-key -- just once in |
Yep, that output is what I would expect. Does that work for you? |
It works for me. |
Was this resolved? I'd could also use functionality mentioned here. |
This would be quite helpful. Merging of the meta data would make setting up content quite easy. |
👍 |
1 similar comment
+1 |
I use this construct in default.html.eco
in my default layout file. The purpose being to only include certain scripts for certain pages.
I then have a blog.html.eco layout which derives from default. I.e. with metadata
However, the scripts metadata item does not get parsed.
In order for this to work I have to put the
scripts:
metadata tag in every blog fileIt would be great if the metadata sort if filtered up the chain
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: