feat: Setup sitemap
The way how @nuxtjs/sitemap
works is as follows:
Visit all static page components (those who don't have dyanmic segments
like _id.vue
). From there traverse all <nuxt-link>
s. While building
the sitemap, nuxt will also call backend APIs in asyncData()
. Too bad
that we're not using asyncData
yet.
@keorn if any dynamic sites should be generated, we have to manually
call the backend and generate a list of routes in the
generate.routes()
hook in nuxt.config.js
. This does not apply for
arbitrary search tearms &p=Some+string
but for any list of entities
that would otherwise populate a RESTful route like /item/4711
.
Do we have any pre-known routes at build time?
You can see the sitemap here: http://localhost:3000/sitemap.xml
As of now:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url>
<loc>http://localhost:3000/account</loc>
</url>
<url>
<loc>http://localhost:3000/faq</loc>
</url>
<url>
<loc>http://localhost:3000/list</loc>
</url>
<url>
<loc>http://localhost:3000/search</loc>
</url>
<url>
<loc>http://localhost:3000/standard</loc>
</url>
<url>
<loc>http://localhost:3000/terms</loc>
</url>
<url>
<loc>http://localhost:3000/use-cases</loc>
</url>
<url>
<loc>http://localhost:3000/</loc>
</url>
</urlset>