When I originally looked at the "exclude" option, I thought it meant that it excluded pages completely, but it apparently doesn't. What I've found in practice is that a file which matches the "exclude" regex is excluded from processing, but it is still copied over to the destination directory. Thus, for example, if I have "^Makefile$" as the exclude pattern, and I have a file src/foo/Makefile, then that file is copied unaltered into dest/foo/Makefile. However, what I want is for src/foo/Makefile to be completely ignored: that it is not only not processed, but not even copied into the destination directory.

I'm not sure if the current behaviour is a bug or a feature, but I would like a "totally ignore this file" feature if it's possible to have one.

-- KathrynAndersen

It looks as though you might only be excluding a top-level Makefile, and not a Makefile in subdirectories. Try excluding (^|/)Makefile$ instead, for instance? (See wiki_file_prune_regexps in IkiWiki.pm for hints.)

The match operation in &file_pruned ends up a bit like this:

"foo/Makefile" =~ m{…|…|…|(^|/)Makefile$}
Comment by smcv Tue Nov 23 06:43:21 2010

I discovered that I not only needed to change the regexp, but I also needed to delete .ikiwiki/indexdb because file_pruned only gets called for files that aren't in the %pagesources hash, and since the file in question was already there because it had been put there before the exclude regex was changed, it wasn't even being checked!

KathrynAndersen

Comment by kerravonsen [dreamwidth.org] Wed Nov 24 22:55:20 2010
%pagesources gets nuked when you rebuild the whole wiki with eg, ikiwiki -setup or ikiwiki -rebuild. So you shouldn't normally need to remove the indexdb, just rebuild when making this sort of change that affects the whole site.
Comment by joey Mon Nov 29 16:41:49 2010

One would think that would be the case, yes, but for some reason it didn't work for me. 8-(

KathrynAndersen

Comment by kerravonsen [dreamwidth.org] Mon Nov 29 22:35:43 2010
Joey, I believe I see the same problem with 3.20120202. I add foo.mdwn, run ikiwiki --setup ikiwiki.setup, add "exclude: foo", run --setup again and it still says "building foo.mdwn".
Comment by tbm [myopenid.com] Tue Mar 20 14:35:41 2012