@1amageek/open-graph-protocol 中文文档教程

发布于 4年前 浏览 28 项目主页 更新于 3年前

open-graph-protocol.ts

Usage

const og: OpenGraph.Metadata<"video.movie"> = {
    type: "video.movie",
    title: "Open Graph Protocol",
    image: "image url",
    url: "url",
    locale: ["en_US", { alternate: "en_GB" }, { alternate: "id_ID" }],
    video: {
        url: "video url",
        actor: "1amageek",
        director: "director 1amageek",
        writer: "writer 1amageek",
        duration: 122,
        release_date: new Date(),
        tag: ["a", "b", "c"]
    }
}

const metadata = {
    og: og
}

console.log(OpenGraph.build(metadata))

open-graph-protocol.ts

Usage

const og: OpenGraph.Metadata<"video.movie"> = {
    type: "video.movie",
    title: "Open Graph Protocol",
    image: "image url",
    url: "url",
    locale: ["en_US", { alternate: "en_GB" }, { alternate: "id_ID" }],
    video: {
        url: "video url",
        actor: "1amageek",
        director: "director 1amageek",
        writer: "writer 1amageek",
        duration: 122,
        release_date: new Date(),
        tag: ["a", "b", "c"]
    }
}

const metadata = {
    og: og
}

console.log(OpenGraph.build(metadata))
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文