Skip to content

Commit 2fef772

Browse files
committedMar 19, 2025·
fix: register missing template params plugin
1 parent 2bdf4fa commit 2fef772

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/runtime/app/composables/defineOgImage.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { ActiveHeadEntry } from '@unhead/vue'
22
import type { DefineOgImageInput, OgImageOptions } from '../../types'
3+
import { injectHead } from '#imports'
4+
import { TemplateParamsPlugin } from '@unhead/vue/plugins'
35
import { defu } from 'defu'
46
import { appendHeader } from 'h3'
57
import { createError, useNuxtApp, useRequestEvent, useRoute, useState } from 'nuxt/app'
@@ -12,6 +14,8 @@ import { createOgImageMeta, normaliseOptions } from '../utils'
1214
export function defineOgImage(_options: DefineOgImageInput = {}) {
1315
const nuxtApp = useNuxtApp()
1416
const route = useRoute()
17+
const head = injectHead()
18+
head.use(TemplateParamsPlugin)
1519
const basePath = route.path || '/' // (pages may be disabled)'
1620
// if we're loading the same path as the SSR response
1721
if (nuxtApp.payload.path === basePath) {

0 commit comments

Comments
 (0)
Please sign in to comment.