Skip to main content

prefer-theme-config-metadata-property-for-og-tags

Require themeConfig.metadata Open Graph entries to use property instead of name.

Targeted pattern scopeโ€‹

This rule targets docusaurus.config.* files and inspects themeConfig.metadata entries.

What this rule reportsโ€‹

This rule reports metadata entries that use name for static Open Graph keys such as og:image.

Why this rule existsโ€‹

Open Graph metadata is conventionally emitted through property. Using the canonical key form makes metadata easier to audit and aligns with common tooling expectations.

โŒ Incorrectโ€‹

export default {
themeConfig: {
metadata: [{ name: "og:image", content: "https://example.com/card.png" }],
},
};

โœ… Correctโ€‹

export default {
themeConfig: {
metadata: [{ property: "og:image", content: "https://example.com/card.png" }],
},
};

Behavior and migration notesโ€‹

This rule autofixes by renaming the metadata key from name to property for matching static Open Graph entries.

When not to use itโ€‹

Do not use this rule if your metadata pipeline intentionally relies on nonstandard Open Graph key handling.

Rule catalog ID: R070

Further readingโ€‹