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

Extra feature: ignore subdirectories #63

Closed
Timmmy opened this issue Jan 11, 2014 · 8 comments
Closed

Extra feature: ignore subdirectories #63

Timmmy opened this issue Jan 11, 2014 · 8 comments
Milestone

Comments

@Timmmy
Copy link

Timmmy commented Jan 11, 2014

Hi Simon,

I've added support to ignore a directory (including subdirectories) in a fork (https://github.com/Timmmy/sigal/tree/Testbranch2). (Code needs some cleanup though)

When a file with the name '.sigalignore' is detected in a directory, it will ignore this directory and all subdirectories. I use this because we store all our pictures in one filetree, but we don't want all the pictures in the album.

Are you interested in including this feature in your repo?

Kind regards,

Tim

@saimn
Copy link
Owner

saimn commented Jan 14, 2014

Hi Timmmy,
Thanks for the proposition. I would prefer to have a new setting in the settings file, which would contain a list of directories (or patterns) to ignore. This could be done easily with the fnmatch module (http://docs.python.org/2/library/fnmatch.html). What do you think ?

@Timmmy
Copy link
Author

Timmmy commented Jan 26, 2014

Hi Simon,

Sorry for the late response...

That would probably be a better solution for most users. However, in my case, it would be difficult to maintain such a list since there is no general pattern in which directories to ignore.

If you put code in the settings file, is it executed when the settings are loaded?
In that case we could implement an ignore list as you described above, but you can still build the list on the fly by adding some code in the settings file. I can then use the ignore files to build the ignore list...

What do you think?

@RSully
Copy link

RSully commented Mar 20, 2014

I would like to see pattern based ignores.

@saimn
Copy link
Owner

saimn commented Mar 22, 2014

Hi @RSully ,
it is something I have started to work on for directories, I will see how to make this work also for files.

@RSully
Copy link

RSully commented Mar 24, 2014

Great! I don't see why it shouldn't just apply to both - presumably using a glob pattern?

@saimn
Copy link
Owner

saimn commented Mar 24, 2014

I have added two settings, mostly for performance reasons (if you want to filter only directories, you don't want to match the patterns on all the files). It takes a list of pattern with the fnmatch module:
http://docs.python.org/2/library/fnmatch.html

@saimn saimn closed this as completed Mar 24, 2014
@Timmmy
Copy link
Author

Timmmy commented Apr 19, 2014

Hi Simon,
Excellent addition, thanks!! (and sorry for the late response)
I've switched to pattern matching (adding suffix to dir names) instead of files so I can use your standard code.

Thank you for creating and maintaining an excellent piece of open source software!!

@saimn
Copy link
Owner

saimn commented Apr 20, 2014

Hi Timmmy,
thank for the kind words :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants