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 note about naming of collections_dir #6703

Merged
merged 1 commit into from Jan 19, 2018
Merged

Add note about naming of collections_dir #6703

merged 1 commit into from Jan 19, 2018

Conversation

paulrobertlloyd
Copy link
Contributor

Clarifying situation in follow up to #6702. /cc @ashmaroli


<p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_posts</code> directory to <code>my_collections/_posts</code>.</p>
<p>If you want to move your `_posts` folder inside the custom collections directory as well, the name of the `collections_dir` cannot start with an underscore (_).</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no scope for a "If you want to move _posts.."
Its always, "If you specify a custom directory.., then _posts has to be moved into it as well.."
and since _posts won't be read inside directories starting with an underscore, it implies:

Custom collections_dir cannot start with an underscore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, that’s not the behaviour I’m seeing. I can set a custom collections directory, and have my _posts folder outside of it. The problem only occurs if I move _posts into a the collections_dir (and it begins with an underscore).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the generated URL to your posts..
./_posts/2018-01-18-hello.md will have generated a ./_site/_posts/2018/01/18/hello.html .. (Note the _posts in your URL..)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I hadn’t spotted that in my test site (and for my own purposes, I am using front matter defaults to explicitly set permalinks for posts). Okay, so how about this:

If you specify a directory to store all your collections in the same place with collections_dir: my_collections, then you will need to move your _posts directory to my_collections/_posts. Note that if you do this, the name of your collections directory cannot start with an underscore (_).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @paulrobertlloyd, 👍 for your last proposal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Do you need me to update this PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, there's no need for two if statements..

If you specify a directory to store all your collections in the same place with collections_dir: my_collections, then you will need to move your _posts directory to my_collections/_posts. Note that, the name of your collections directory cannot start with an underscore (_).

Great. Do you need me to update this PR?

Yes. Please..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashmaroli I wasn’t sure about that, but then realised we are adding this note within the context of moving _posts into the custom directory. So yes, no need for the extra ‘if’. I have updated this PR.

@ashmaroli
Copy link
Member

Therefore, I'm of the opinion, please do not alter the existing note. Instead, add to it..
/cc @jekyll/documentation


<p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_posts</code> directory to <code>my_collections/_posts</code>.</p>
<p>If you want to move your `_posts` folder inside the custom collections directory as well, the name of the `collections_dir` cannot start with an underscore (_).</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @paulrobertlloyd, 👍 for your last proposal

@paulrobertlloyd paulrobertlloyd changed the title Note about naming of collections_dir if _posts folder contained within it Note about naming of collections_dir Jan 19, 2018
@paulrobertlloyd paulrobertlloyd changed the title Note about naming of collections_dir Add note about naming of collections_dir Jan 19, 2018
Copy link
Member

@ashmaroli ashmaroli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@DirtyF
Copy link
Member

DirtyF commented Jan 19, 2018

@jekyllbot: merge +docs

@jekyllbot jekyllbot merged commit af88add into jekyll:master Jan 19, 2018
jekyllbot added a commit that referenced this pull request Jan 19, 2018
@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

4 participants