Feature Request: Add fine-grained control for og:url
and other Open Graph meta tags in useLocaleHead
#3277
Labels
og:url
and other Open Graph meta tags in useLocaleHead
#3277
Describe the feature
Description
Currently, the
useLocaleHead
composable in thenuxt3-i18n
module automatically generates various meta tags, includingog:url
, based on non-configurable logic. While this works for many use cases, it creates challenges when custom logic is required.Use Case
In our project, we manually determine the
og:url
using project-specific logic. We set this customog:url
using the useSeoMeta method. However, when usinguseLocaleHead
with default properties, it adds a secondog:url
meta tag, which cannot be disabled or customized without affecting other tags.Setting
seo: false
inuseLocaleHead
disables all SEO-related meta tags, includingog:locale:alternate
tags andog:locale
for the current page. This is problematic because we only want to disable the automatic generation ofog:url
, while retaining the other meta tags provided byuseLocaleHead
.The relevant behavior can be seen in the following code snippet:
i18n/src/runtime/routing/compatibles/head.ts
Lines 63 to 72 in d239bdd
PR
I’d be happy to contribute a pull request (PR) to implement this feature if the idea is welcomed.
Additional information
Final checks
The text was updated successfully, but these errors were encountered: