Skip to content

Commit

Permalink
perf: split SEO meta data for client/server render
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Feb 13, 2024
1 parent b2ca054 commit b4bc1bc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions composables/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export function setPage<T extends Record<string, any>>(page?: T) {
bodyAttrs: {
'data-template': page.intendedTemplate || 'default',
},
})

useServerHead({
link: [
{ rel: 'canonical', href: url },
...alternateUrls.filter(({ hreflang }) => hreflang !== locale.value),
Expand All @@ -72,6 +75,10 @@ export function setPage<T extends Record<string, any>>(page?: T) {

useSeoMeta({
title,
})

useServerSeoMeta({
title,
description,
ogTitle: title,
ogDescription: description,
Expand Down

0 comments on commit b4bc1bc

Please sign in to comment.