Closed robbertrosario closed 2 years ago
To generate a static sitemap I use new Page()
in the plugin's config ready option :
// config.php
return [
'ready' => function() {
return [
'd4l.static_site_generator' => [
'custom_routes' => return [[
'path' => '/sitemap.xml',
'page' => new Page([
'template' => 'sitemap',
'slug' => 'sitemap',
]),
]];
],
];
}
];
I have a sitemap.php
in the template folder, I don't what you should do with your snippet from the cookbook. Creating a sitemap.php
template which just calls your snippet should work.
That seems to work thanks!
Expected Behavior
I am using this sitemap snippet: https://getkirby.com/docs/cookbook/content/sitemap by Bastian. But it doesn't generate an actual sitemap.xml file it just starts rendering the xml when you access the route.
I've tried using the
ready
function as per README, but thecustom_routes
expect a page id, but the above sitemap snippet is not an actual page? and therefore has no page id?Current Behavior
Sitemap is not generated
Context
Kirby version: 3.7 Plugin version: 1.5.1
Installed using composer