Closed aerni closed 1 year ago
I only had very little time to check but it already looks great! 😍
One thing I noticed though is that it seems, that there is no option to alter the base URL. This would be a very welcome addition still.
@aerni approved, looking good.
@el-schneider you can add your frontend_url
by the code below in sites.php.
'sites' => [
'default' => [
'name' => config('app.name'),
'locale' => 'nl_NL',
'url' => env('FRONTEND_URL', '/'),
],
],
@maartenvanhunsel Awesome! Thanks for taking the time. @el-schneider Can you confirm that adding the frontend URL to the sites config does what you need?
Not really, because this also affects asset urls and a plugin I'm using to generate srcsets. But it's fine. I'll just transform the urls myself.
Oh ok. Will look into adding base_url
.
I added the option to change the baseUrl
. Do you mind giving it a try?
@aerni tested and works like expected. Would you mind to merge :D
Thanks for testing! After looking at it again, I think I might want to separate the collection, taxonomy, and custom sitemaps and structure the query similarly to how the seoDefaults
query is structured.
It would look like this:
query MyQuery {
seoSitemap {
collection(handle: "pages") {
loc
}
taxonomy(handle: "tags") {
loc
}
custom {
loc
}
}
}
This way, we could get rid of the type
argument. And it's always clear which type of sitemap URLs you get. Also, it would more closely resemble the way Advanced SEO's XML sitemaps are structured.
This PR adds GraphQL support for sitemaps.
A basic query looks like this:
You can also filter by
site
:It's also possible to filter by
type
andhandle
. Possible values fortype
arecollection
,taxonomy
, andcustom
.You may also change the
baseUrl
like this: