feat(embeds): add extensible embed registry, universal plugin, and pair-aware sanitizer
This commit is contained in:
16
app/plugins/journal-embeds.ts
Normal file
16
app/plugins/journal-embeds.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// Universal Nuxt plugin syncing `app.config.ts` (`journal.embeds`) into the
|
||||
// active Journal embed registry on both SSR and client before page components
|
||||
// render, so `htmlGate.ts`, `embeds.ts`, and `useJournalEmbedHydration.ts`
|
||||
// agree on the exact same provider set.
|
||||
import { defineJournalEmbedProviders, type JournalEmbedProvider } from '../utils/embedRegistry.ts'
|
||||
|
||||
export default defineNuxtPlugin({
|
||||
name: 'journal-embeds',
|
||||
enforce: 'pre',
|
||||
setup() {
|
||||
const appConfig = useAppConfig() as { journal?: { embeds?: Record<string, JournalEmbedProvider> } }
|
||||
if (appConfig?.journal?.embeds) {
|
||||
defineJournalEmbedProviders(appConfig.journal.embeds)
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user