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.
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? (Seewiki_file_prune_regexps
inIkiWiki.pm
for hints.)The match operation in
&file_pruned
ends up a bit like this: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
%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.One would think that would be the case, yes, but for some reason it didn't work for me. 8-(
KathrynAndersen
I also encountered this bug (having to delete indexdb) in 3.20120629.
-- Martin
I am not sure if that is a bug or a feature, but it is annoying, definitively related to this post:
I am really confused with the exclude feature and the way ikiwiki lookup files. Finally I tend to think this is a bug.
Is there a way to make ikiwiki consider that a file in the
srcdir
should not be present in thedestdir
and thus removed if present?--bbb