Skip to content
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

Add some tests for custom collections directory #6679

Closed
wants to merge 6 commits into from

Conversation

ashmaroli
Copy link
Member

Replaces #6678
Cucumber tests for custom collections_dir configuration

@pathawks
Copy link
Member

pathawks commented Jan 7, 2018

So, when there is a custom collections_dir, the _posts directory needs to be moved into that directory instead of in the top level?

@ashmaroli
Copy link
Member Author

ashmaroli commented Jan 7, 2018

So, when there is a custom collections_dir, the _posts directory needs to be moved into that directory instead of in the top level?

Yes. _posts is a collection too.. just that it is a special collection..

  • documents are always rendered — you can't hide them
  • documents can be ignored with a published: false
  • documents have a different naming pattern (YYYY-MM-DD-title.markdown)
  • documents have categories and tags associated with it
  • has _drafts associated with it

@localheinz
Copy link
Contributor

@ashmaroli

Ha, then this isn’t actually a bug, but rather a documentation issue?

You can optionally specify a directory to store all your collections in the same place with collections_dir: my_collections
Then Jekyll will look in my_collections/_books for the books collection, and in my_collections/_recipes for the recipes collection.

It wasn’t obvious to me that _posts should be moved into the collections directory as well.

@ashmaroli
Copy link
Member Author

ashmaroli commented Jan 7, 2018

but rather a documentation issue?

@localheinz Yep. You're welcome to submit a PR for improving the documentation..

@localheinz
Copy link
Contributor

@ashmaroli

Can confirm that this works for me!

With a custom collections_dir set, posts at the root of the site get
processed into _site/_posts/ directory whereas drafts at the root do not
get processed into _site/ directory

props to @localheinz for reporting the bug
@ashmaroli
Copy link
Member Author

I take back most of what I have said over the span of last 8 hours.. 😄 @localheinz was right! There is a bug in the code in fact..!!

My Apologies @localheinz !!

Documents within <source>/_posts do get processed into the _site. They get rendered into _site/_posts/ and are accessible via liquid construct {{ site.posts }} as well..

@localheinz
Copy link
Contributor

localheinz commented Jan 7, 2018

@ashmaroli

Ha, nice, wasn't quite sure what I was doing wrong.

Thanks a lot for your work on this!

@ashmaroli
Copy link
Member Author

We were both right and wrong at the same time.. 😄
I kept testing with _posts in the collection_dir while you kept building with _posts at the root.. It was only when I combined both scenarios did I realize the true gravity of the situation.. 😉

@ashmaroli
Copy link
Member Author

closing in favor of #6685

@ashmaroli ashmaroli closed this Jan 9, 2018
@ashmaroli ashmaroli deleted the test-coll-dirs branch January 9, 2018 07:13
@6r0k3d 6r0k3d mentioned this pull request Aug 17, 2018
18 tasks
@jekyll jekyll locked and limited conversation to collaborators Jul 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants