-
Notifications
You must be signed in to change notification settings - Fork 19
Collection files don't display without YAML front matter #223
Comments
The only way to get the patterns generated by Jekyll was to add empty front matter to each file. I don’t think this is right, so I’ve raised a ticket with Jekyll: jekyll/jekyll-help#223
As far as I know, Jekyll will only process a file through it's generator system if it contains front-matter. I honestly don't know the history of that behavior, but I feel like it's been like that since Collections was introduced. Obviously there could be nuiances that I'm not aware of, but the idea is generally: "Add front-matter to files that you want Jekyll to process." |
It did used to work. If that's how it is now, would it be worth changing the wording of the documentation? This had me thinking it would process a file without front-matter:
|
@maban That's a very inspirational use of Jekyll, I love it! 🙇 |
Thank you, @nternetinspired! I'm also building a jekyll-based collaborative bookmarking tool. Here are my very early workings: https://github.com/maban/bookmarks |
Looks great @maban, I'll certainly keep an eye on that. I'm really interested in how Jekyll can be used in new ways, like cutting production time of the less glamorous, but essential, parts of the web design process; and I think style guides are a really important part of that. I've been dabbling with using Jekyll to replace traditional web design tools in rapidly creating things like element collages, style tiles, and type samples in addition to just wireframing: https://github.com/nternetinspired/jekyll-design A fully fleshed out pattern library is next on my hit list… |
Oooh, looks really cool! |
Hey @nternetinspired, your project looks fantastic! I love what people are doing with Jekyll… next on my list is Jekyll-ising my Barebones project (https://github.com/paulrobertlloyd/barebones). |
Thanks for the kind words @paulrobertlloyd 😊 I really need to give it some more time and refine things a bit further because I'm happy with how it works as a POC. I'll be keeping an eye on Barebones for inspiration ;) |
I'd agree here that the docs need a fix, or the behaviour needs changing so files without front matter are processed. |
Oh, the docs are on GitHub! I'll try and write something that might help clarify things, and do a pull request after work. |
Actually, it would be very useful if files without a front matter could be processed too. My use case is that my collection contains HTML files representing charts of C++ benchmarks. These benchmarks are updated nightly by a CI script, and they should also be viewable as-is. Hence, generating the files with a front matter is not an option. Right now, the only thing I can do is add a dummy front-matter to those files so that they are processed, but it's not ideal. |
Files without frontmatter were definitely supported in the past. I added a collection of markdown-formatted recipes with no frontmatter to my site in October 2014 and have had it there ever since. I copy the collection from another repository where the frontmatter would be in the way. To get my collection building again after an accidental upgrade of Jekyll, I had to downgrade to Jekyll 2.1.1. To do this, run:
Before I downgraded, I confirmed the bug by adding frontmatter (just a title) manually to one file, which then generated. I wasn't able to test older versions than 2.1.x because the gems would no longer build for me. |
I've been playing with collections since they first came out and I built this with it: http://style.maban.co.uk/ (code here: https://github.com/maban/styleguide) – each item on the page is pulled from a collection which is a series of pure HTML files that don't contain any front matter, and I generated it like this:
and in my config file I've got
It was working great until recently, and I hadn't touched the code until someone said it wasn't working for them and I tried it out again locally. Now when I build the site, none of the files in the collection get generated on the page. The only way they'll display at all is if I insert an empty front matter to each file in the collection.
In the documentation for the content variable of collections, it says "If no YAML Front Matter is provided, this is the entirety of the file contents.", so it should still work, right?
Has something changed in the codebase that basically says "don't output this collection file if it's not got front matter"? Or am I doing something wrong – is there a way to force it to generate it anyway?
The text was updated successfully, but these errors were encountered: