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
Option to force document rendering #3583
Conversation
I like to documentation but I think we shouldn't have this overriding behaviour. Not having the YAML front matter means it's not a convertible page, and that holds for all things Jekyll (afaict) except layouts. Content is only renderable with the |
My particular usecase is that I have a custom converter that turns documents from the Elm language into HTML files, and I have a liquid tag that embeds examples in the form of source code followed by an iframe pointing to the generated file. Using static files, I would need to recreate the conversion step in the the example embed plugin. Using documents, I would need to have empty, boilerplate in my elm files. Is there another way to get that desired behavior? |
Insert the YAML front matter in a build step that runs before Jekyll? |
That doesn't sound particularly reusable for a public plugin! I guess, in terms of recreating the conversion step, I would just have to map the files into documents, which I don't think will be too difficult. That is what I am going to try, at least! Feel free to take and discard what you want from this pull request 😄 |
In case you are curious, I was able to hack together a workaround. It is so dangerous looking, dubios, and probably downright fragile that I almost feel bad about it, but it works! I'd be interested to hear any critiques about this method. It looks like collections have been stable enough for long enough that this shouldn't be too problematic. |
Any file without valid front matter in a collection is available via `collection.files`. Inspired by #3583.
Sweet! Thanks for adding in the documentation and the (as always) prompt responses! |
You bet, thanks for the PR 👍 |
No worries, dude. I actually just saw that you went to Cornell, and I feel like a complete ass, hah! I am class of 2008 and still live in Ithaca! I would have gladly bought you a beer for all you've done, had I known before today. If you come back to visit in the next few months, let me know! |
Any file without valid front matter in a collection is available via `collection.files`. Inspired by jekyll#3583.
Hah, no problem man. Yeah, I just left last summer! I'm sure I'll be back. Enjoy the winter for me! 😉 ❄️ |
Any file without valid front matter in a collection is available via `collection.files`. Inspired by jekyll#3583.
Some time ago, a change was made to the way collections are processed that treats files without front matter as being static files (#2737). While this assumption makes sense in most cases (I haven't seen anyone complain about it yet!), these behave so much differently from the normal
Jekyll::Document
that they are much more difficult to work with in cases where the consumer of the collection does still want them to be processed. In my particular case, I am using two of my plugins in conjunction (sonnym/jekyll_example_embed && sonnym/jekyll_elm) to render and embed examples. Having the front matter in files written in a different language is unsightly, so I added an option that preserves the old behavior.I also documented how static files work, as the original pull request that added them as a part of collections did not include any changes to the documentation.
Please let me know if you would like to see any additional work to this! Thanks!