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
Simplify front matter defaults syntax #50
Comments
We should do a full performance review of front matter defaults in general as part of this issue. Related issue in Jekyll: jekyll/jekyll#8188 (it's unclear to me why lazily-loading defaults improves the build time so much…not something I would expect) |
So heres the current syntax from bridgetown/bridgetown-website/bridgetown.config.yml Lines 17 to 34 in 8c01329
The I do like the idea of it being top level in the config rather than being nested into a However, I have also thought about the idea of the user defining defaults inside of a IE:
Of course, I imagine the performance implications of reading multiple |
@ParamagicDev I agree performance should be a concern, but since the number of defaults files would probably be fairly low for an entire site even with thousands of individual pages, I can't imagine it would be a huge hit over a single file. I really like your idea of a "data cascade" based on the filesystem itself — both Eleventy and Hugo have similar concepts, for example. |
OK, I'm going to give the data cascade idea a try. For this initial version, I'm thinking it is only collection-scoped, so |
Update: I got it working with subfolder trees out of the gate. 😃 See #139 |
I'm keeping this issue open for a bit longer in case we have ideas for further improvements, but I think #139 will address most of the things people expect to do with front matter defaults. |
I think we're good to go at this point. Closing. |
Update: we ended up opting for a "data cascade" folder-based approach rather than changing the syntax of the defaults key in the config. See #139
I've always found the YAML syntax for defining front matter defaults to be extremely obtuse and I always have to look up a reference to remember how the heck to write it out. Really all I want to do is:
Let's make this a whole lot better and then deprecate the old syntax with the goal of removing it for the 1.0 release.
Note: it should be a pretty straightforward swap because the old syntax is array-based, whereas the new one will be hash-based, so we can easily detect which syntax is being used.
The text was updated successfully, but these errors were encountered: