omz13 / kirby3-xmlsitemap

kirby3 plugin to generate an xml-based sitemap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide a way to manually add pages

LeBenLeBen opened this issue · comments

I was using https://github.com/pedroborges/kirby-xml-sitemap with Kirby 2 and I'm currently moving to your plugin while migrating to version 3. Everything seems to work fine so far, except that I miss a way to manually add pages to the sitemap.

I need this feature to be able to push virtual pages made with custom routes and models.

With the plugin mentioned above, I used to do this:

c::set('sitemap.process', function(Collection $pages) {
  $users = kirby()->users();
  foreach ($users as $user) {
    $page = new CustomPageModel(site()->page('team'), 'profile', compact('user'));
    $pages->data['team/' . $user->username()] = $page;
  }
  return $pages;
});

Do you think that is a feature you could add?

In any case, thanks for the time you put into this very useful plugin!

Will have a think about the best way to add this... will probably be a configuration option for a collection of pages to add to the sitemap.

Thank you!