WithCandour / statamic-aardvark-seo

Candour's SEO addon for Statamic
https://statamic.com/marketplace/addons/aardvark-seo
11 stars 18 forks source link

Not currently possible to override sitemap route #148

Closed duncanmcclean closed 1 year ago

duncanmcclean commented 1 year ago

We'd like to override the sitemap that Aardvark provides with our own. The only issue we're running into is that we're unable to override the /sitemap.xml route that Aardvark comes with.

We've tried manually booting Aardvark before our own service providers, putting it in a Statamic::booted closure, etc.

Ideally, the sitemap would be enabled/disabled in a config file, then you could check the config to see if it's enabled before registering the route.

However, it looks like Aardvark is always registering the route, even if the sitemap is disabled. Then, if disabled, it aborts with a 404. This is probably because the config setting isn't stored in a config file & wouldn't be very performant to check whenever the routes are booted.

duncanmcclean commented 1 year ago

The whole reason we needed to override it was to use separate sitemaps. However, turns out Aaardvark does that already but it was timing out on production - it seems to be loading fine now though so I'll close this issue 🤷‍♂️