feat: noindex for declared and signed-in routes
- app plugin seo-route-robots: a page whose meta sets requiresAuth: true gets robots noindex, nofollow, a page with seo.robots gets its value, a path under seo.noindexRoutes gets noindex, nofollow; meta tag above the CMS head entry and X-Robots-Tag during SSR, never on staging - requiresAuth and seo added to Nuxt's page meta extraction keys - playground /konto, /szkic and /prywatne with their smoke lines
This commit is contained in:
@@ -73,6 +73,13 @@ export default defineNuxtModule<SeoModuleOptions>({
|
||||
const ssr = nuxt.options.ssr !== false
|
||||
const inlineRouteRules = nuxt.options.experimental?.inlineRouteRules === true
|
||||
|
||||
// requiresAuth and seo are read from definePageMeta at build time, so
|
||||
// the route report leaves signed-in and noindex pages out (D-23).
|
||||
const extract = new Set(nuxt.options.experimental.extraPageMetaExtractionKeys ?? [])
|
||||
extract.add('requiresAuth')
|
||||
extract.add('seo')
|
||||
nuxt.options.experimental.extraPageMetaExtractionKeys = [...extract]
|
||||
|
||||
// Build guard (D-70). Nitro's config hook runs once every layer and
|
||||
// module has merged its rules into it; there the declared noindex
|
||||
// routes get their X-Robots-Tag rule. The pages are resolved after
|
||||
|
||||
Reference in New Issue
Block a user