It looks like there are about 137 plugins for generating sitemaps, and not having a clue if any of them are better than any others, I’m just going with the standard sitemap template mentioned in the Kirby docs.
It’s really easy to exclude individual pages, but it doesn’t exclude entire directories.
So, questions:
What is the easiest way with a collection of Kirby pages (in this case, the index) to exclude an entire subdirectory? I don’t want to dig too deep into PHP parsing if there’s an easy way already.
If there’s a sitemap generating plugin available that makes #1 easier, I would be open to that.
$ignore = array('sitemap', 'error'); // pages with uri IN $ignore are ignored
$templateignore = array('internal', 'members' , 'member'); // pages with template IN $templateignore are ignored
… and the following using this vars.
[Added:]
You can use the same solution for a webpage with the html-sitemap, which shows the links to several of your (may be visible) webpages.
This also supports an array in the excluded variable, something like $excluded = page('somepage')->index(), page('someotherpage')->index()), so it’s perfect for what I need. Just have ->not($excluded) along with ->not($ignore) for the ignored pages, and it’s golden.
I’m not eliminating invisible pages, because the current site structure uses some “invisible” pages as primary pages due to our weird navigation.
I have not yet figured out how to have items in $ignoredirs ignore the parent, so you need to also include the parent in $ignore if you want that parent hidden. This can actually be handy sometimes, though, because I have a page that I want to show up, but the children are only there for being pulled into the main page, so I don’t want them to show in the sitemap because they won’t be linked to directly.
The $numerouno array is specific pages that you want to explicitly set as the highest priority in the sitemap. Everything else is based on depth.
You’ll notice I’m calling events separately. That’s because all other content, I only want included if the date isn’t in the future, but for events I obviously want to include future dates, as they’re the most important.