Thus, when in SSR mode, we can get robots.txt data from api and dynamically generate robots.txt.
like nuxt-community/gtm-module
GTM Initialisation
If you want to block Google Tag Manager before user directly allows (GDPR realisation or other), you can set autoInit option to false and then manually enable using $gtm.init().
Note: All events will be still buffered in data layer but won't send until init() method getting called.
@everyx sorry, I not sur to understand.
What do you mean by "Allow manually configure routes"?
Which kind of routes? (static or dynamic)
Can you give a concrete example on sitemap context, please?
Sorry for my english.
I mean that if we want modify the sitemap content, we must rebuild it, if we can manually init sitemap on server side, we can have a dynamic sitemap.
But the sitemap is already dynamic in SSR mode with the routes
option.
To each call to your https://example.org/sitemap.xml
, the module will rebuild the sitemap.
See example: https://github.com/nuxt-community/sitemap-module#from-a-function-which-returns-a-promise
But the sitemap is already dynamic in SSR mode with the
routes
option.
To each call to yourhttps://example.org/sitemap.xml
, the module will rebuild the sitemap.See example: https://github.com/nuxt-community/sitemap-module#from-a-function-which-returns-a-promise
@NicoPennec Yes, but if we use if I use routes: () => // promise or function
in nuxt.config.js
, it will not re-execution the promise or function
, so if we want have a realtime result of this promise or function
, we need rebuild the project, so if I have some Dynamic Routes changed from my api, I have no way to do this.
if you need dynamic routes, you have to use the dynamic routes declaration on the sitemap module option.
The promise will be execute to each call of /sitemap.xml
and not on build!
Test by your self:
sitemap: [
{
routes: async () => {
const { data } = await axios.get('http://worldclockapi.com/api/json/utc/now')
return [`/time/${data.currentFileTime}`]
},
cacheTime: 1
}
]
nb: by default the sitemap-module set a cache time of 15 minutes (see options)
@everyx sorry, I not sur to understand.
What do you mean by "Allow manually configure routes"?
Which kind of routes? (static or dynamic)
Can you give a concrete example on sitemap context, please?