oekazuma/svelte-meta-tags

og:type is not working

huseeiin opened this issue · 3 comments

Describe the bug
A clear and concise description of what the bug is.

in +layout.svelte

<MetaTags
    titleTemplate="%s - App"
    openGraph={{
        type: "website",
        url: href,
    }}
    canonical={href}
    {...$page.data.metaTagsChild}
/>

all tags are working except openGraph.type

Can you give us some more details?
What is the value of $page.data.metaTagsChild?

Can you give us some more details? What is the value of $page.data.metaTagsChild?

its different for every page but its something like this

export const load = () => {
    const metaTags: MetaTagsProps = {
        title: "Home",
        openGraph: {
            title: "Home",
        },
        twitter: {
            title: "Home",
        },
    };

    return {
        metaTagsChild: metaTags,
    };
};

Sorry, there was an error in the documentation.
JavaScript usually does not allow deep merging of objects, so you need to have a function that allows deep merging.

Please refer to the detailed example I have created.
https://github.com/oekazuma/svelte-meta-tags/tree/main/example