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

.htaccess is left out when copying static files #377

wants to merge 1 commit into
base: master


None yet
5 participants

agorf commented Aug 1, 2011

It's because of the glob pattern used in read_directories() that does not take into account hidden files. The suggested pattern in the relevant commit does.


This comment has been minimized.

jnrbsn commented Aug 6, 2011

I've run into problems in the past using .* in a glob pattern, because it includes . and .. which are generally not desired.


This comment has been minimized.

agorf commented Aug 6, 2011

This is what the glob pattern is supposed to return among other things. It's the programmer's job to reject everything they don't want. :-)

But even if you look at the source, this is taken care of by filter_entries() which excludes everything starting with . among other things.


This comment has been minimized.

jnrbsn commented Aug 8, 2011

I'm not going to pretend to have looked through every bit of code involved here, but based on my understanding of your response, I get the impression that we're talking about two different things. To clarify, I was not referring to items starting with a dot, but instead, a single dot and a double dot which represent the directory itself and its parent directory, respectively, on Unix-style file systems. My concern was that, if these were included, it might create an undesirable circular reference of some sort. If this is how you understood my comment, then I apologize for my repetition.

I'm also somewhat confused. When you say it's the "programmer's job", are you referring to the person building a Jekyll site or the person writing Jekyll itself? Also, if filter_entries() "excludes everything starting with . among other things" like you say, then how would passing it those items, like in your commit, have any effect?


This comment has been minimized.

agorf commented Aug 8, 2011

All your questions will be answered if you look at the source. :-) Sorry if I have been vague, I was assuming you had already done it.

Regarding your first paragraph, you are correct, this is how I understood your comment. If you exclude everything starting with a dot, you also exclude . and ...

Regarding your second question, filter_entries() has an unless statement which checks for .htaccess and does not exclude it. So the end result is everything starting with a . gets excluded, apart from .htaccess, which is the desired behaviour.

When I say "programmer's job" I'm referring to the person building the platform (i.e. Jekyll), not the site. IMO, just because .* returns . and .. (which it should) and people make mistakes with it (by forgetting to exclude them), is not a good enough reason not to use it. With great power, comes great responsibility; a language should not restrict the programmer from mistakes like this.


This comment has been minimized.

sumbach commented Nov 2, 2011

Is this a duplicate of #363?


This comment has been minimized.

agorf commented Nov 2, 2011

Seems to be!

@mojombo mojombo closed this in 9d70088 Jan 23, 2012

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.