- extend vue-seo-layer (link dependency during development); every page takes its head from the SEO plugin through it - remove the copied shared purge route, library, plugin and their test: POST /api/__site__/cache/purge comes from vue-seo-layer with the same contract and environment variables - the page-less playground sets seo.htmlSitemap false; the smoke points NUXT_SEO_API_BASE at the fixture API (fails open) BREAKING CHANGE: server/api/__site__/cache/purge.post.ts, server/lib/siteCachePurge.ts and server/plugins/site-cache-purge.ts are no longer in this layer, and the runtime keys cachePurge and siteCache are declared by vue-seo-layer. An app without pages sets seo.htmlSitemap false.
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
// vue-menu-layer: renders a menu of the SummerCMS menu plugin
|
|
// (GET /_menu/api/v1/menus/{code}) as an accessible site navigation. An app
|
|
// consumes it with `extends: ['vue-menu-layer']` and renders <MenuNav>.
|
|
//
|
|
// Every path below is absolute and built from this file's directory: a
|
|
// relative or ~ path in a layer config resolves against the consuming
|
|
// project, not the layer. The layer declares no Nuxt modules; it extends
|
|
// vue-seo-layer, which owns the page head and the shared site cache purge
|
|
// route POST /api/__site__/cache/purge.
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const currentDir = fileURLToPath(new URL('.', import.meta.url))
|
|
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: '2025-07-15',
|
|
devtools: { enabled: false },
|
|
|
|
// Resolved from this layer's own node_modules.
|
|
extends: ['vue-seo-layer'],
|
|
|
|
// Tokens first, then the neutral styles that use them. The app's own css
|
|
// array loads after these, so its token overrides win.
|
|
css: [`${currentDir}app/assets/css/menu-tokens.css`, `${currentDir}app/assets/css/menu-base.css`],
|
|
|
|
runtimeConfig: {
|
|
menu: {
|
|
// Server-only base for SSR fetches (NUXT_MENU_API_BASE). It never
|
|
// comes from request input.
|
|
apiBase: 'http://127.0.0.1:8096/_menu/api/v1',
|
|
},
|
|
public: {
|
|
menu: {
|
|
// Same-origin base for browser fetches (NUXT_PUBLIC_MENU_API_BASE).
|
|
apiBase: '/_menu/api/v1',
|
|
},
|
|
},
|
|
},
|
|
})
|