addLanguageAlternate(schema: Record<string, any>,alternateId: string,isOriginal: boolean): Record<string, any>
Helper function to manually add language alternate links to a schema
Useful for custom schema objects created in templates or frontmatter.
Example 1
Example 1
const schema = { "@id": "https://example.com/en/page/#content", "@type": "WebPage", // ... }; addLanguageAlternate( schema, "https://example.com/ja/page/#content", true // This is the original English version ); // Result: schema now has workTranslation: [{ "@id": "https://example.com/ja/page/#content" }]