routes var in generate section will auto generate sitemap content

sandalwoodsh
0
sandalwoodsh
commented 2 months ago

If routes are not defined here:
sitemap: {
path: "/sitemap.xml",
hostname: "https://example.com"
}

AND a variable "routes" is found in the generate section, then the routes will be added automatically to the sitemap file.

generate: {
routes: function() {
return axios
.get(“blahblahblah”)
.then(res => {
const routes = [];
[…]

      return routes;
    });
}

}

0
NicoPennec
1.7k
NicoPennec
commented 2 months ago

yes, it's a feature as explain in the doc

routes (optional) - array | function

Default: [] or generate.routes value from your nuxt.config.js

0
sandalwoodsh
0
sandalwoodsh
commented 2 months ago

Thanks, Nicolas. It's great that it does that. I guess my question was how
can I add other parameters to each route so that it saves out to the file
as well. I can't save anything else other than the route.

On Thu, Feb 20, 2020, 6:50 PM Nicolas PENNEC notifications@github.com
wrote:

yes, it's a feature as explain in the doc
https://github.com/nuxt-community/sitemap-module#routes-optional---array--function

routes (optional) - array | function

Default: [] or generate.routes value from your nuxt.config.js


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/nuxt-community/sitemap-module/issues/102?email_source=notifications&email_token=AAIKFYYS6MQF7US2GEQBOYLRD4JNVA5CNFSM4KVU5FM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMQ7K5Q#issuecomment-589428086,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAIKFYZAY6W7Y5BAB4QX2MTRD4JNVANCNFSM4KVU5FMQ
.

0
Informations
QuestionUnresolved
#c78 - Created 2 months ago