ikiwiki/ todo/ conditional underlay files

I'd like to see some way to include certain files from the underlay only when the wiki has certain plugins enabled. For example:

I can see two good ways to implement this. Ideally, with conditional text based on ikiwiki features available, ikiwiki could parse a page like conditionalpages.mdwn, which could contain a set of conditional-wrapped page names; that seems like the most elegant and ikiwiki-like approach. Alternatively, ikiwiki.setup could contain a Perl-generated exclude option by default; that would work, but it seems hackish.

Another way might be to have a third directory of source files where plugins could drop in pages, and only build the files from there if their plugins were enabled.

Using the conditionals in a page to control what other pages get built feels complex to me, --Joey