feat: vue-seo-layer, the Nuxt half of the SummerCMS SEO plugin

This commit is contained in:
Jakub Zych
2026-10-31 13:45:37 +01:00
commit ac59f3c80d
30 changed files with 7962 additions and 0 deletions

14
app/plugins/seo-head.ts Normal file
View File

@@ -0,0 +1,14 @@
// One head entry for the whole app, following the resolve answer of the
// current page. tagPriority 'critical' makes its tags win over the same
// tags a page or another module sets (unhead keeps the lower weight), so
// editor values from the SEO plugin override the content defaults; a value
// the answer lacks leaves the page's own tag in place.
import { seoHeadInput } from '../utils/seo.ts'
export default defineNuxtPlugin(() => {
const config = useRuntimeConfig()
if ((config.public.seo as { enabled?: boolean } | undefined)?.enabled === false) return
const answer = useSeoAnswer()
useHead(computed(() => seoHeadInput(answer.value)), { tagPriority: 'critical' })
})