Skip to content

Commit

Permalink
add filter for hreflangs meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchuman committed Feb 23, 2025
1 parent 0b58593 commit e70986d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/lib/processMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ export default async function processMetadata(
alternates: {
canonical: url,
languages: Object.fromEntries(
page.translations?.map((t) => [
t?.language,
[BASE_URL, t?.language !== DEFAULT_LANG && t?.language, t?.slug]
.filter(Boolean)
.join('/'),
]) || [],
page.translations
?.filter((t) => !!t.language)
?.map((t) => [
t?.language,
[BASE_URL, t?.language !== DEFAULT_LANG && t?.language, t?.slug]
.filter(Boolean)
.join('/'),
]) || [],
),
types: {
'application/rss+xml': '/blog/rss.xml',
Expand Down

0 comments on commit e70986d

Please sign in to comment.