vuepress-plugin-open-graph
Advanced tools
Comparing version 1.2.0 to 1.3.0
import type { Plugin } from '@vuepress/core'; | ||
interface OpenGraphPluginOptions { | ||
host: string; | ||
twitterCard?: 'summary_large_image' | 'summary'; | ||
defaultImage?: string; | ||
twitterCard?: 'summary' | 'summary_large_image'; | ||
twitterSite?: string; | ||
host: string; | ||
} | ||
export declare let openGraphPlugin: ({ defaultImage, twitterCard, twitterSite, host, }: OpenGraphPluginOptions) => Plugin; | ||
export declare let openGraphPlugin: ({ twitterCard, defaultImage, twitterSite, host, }: OpenGraphPluginOptions) => Plugin; | ||
export {}; |
@@ -1,3 +0,2 @@ | ||
export let openGraphPlugin = ({ defaultImage, twitterCard = 'summary', twitterSite, host, }) => () => ({ | ||
name: 'vuepress-plugin-open-graph', | ||
export let openGraphPlugin = ({ twitterCard = 'summary', defaultImage, twitterSite, host, }) => () => ({ | ||
extendsPage: page => { | ||
@@ -12,3 +11,3 @@ let head = page.frontmatter.head || []; | ||
'meta', | ||
{ property: 'og:description', content: page.frontmatter.description }, | ||
{ content: page.frontmatter.description, property: 'og:description' }, | ||
]); | ||
@@ -21,4 +20,4 @@ } | ||
{ | ||
content: new Date(page.frontmatter.date).toISOString(), | ||
property: 'article:published_time', | ||
content: new Date(page.frontmatter.date).toISOString(), | ||
}, | ||
@@ -29,3 +28,3 @@ ]); | ||
'meta', | ||
{ property: 'og:url', content: `${host}${page.path}` }, | ||
{ content: `${host}${page.path}`, property: 'og:url' }, | ||
]); | ||
@@ -35,7 +34,7 @@ if (page.frontmatter.image) { | ||
'meta', | ||
{ property: 'og:image', content: page.frontmatter.image }, | ||
{ content: page.frontmatter.image, property: 'og:image' }, | ||
]); | ||
} | ||
else if (defaultImage) { | ||
head.push(['meta', { property: 'og:image', content: defaultImage }]); | ||
head.push(['meta', { content: defaultImage, property: 'og:image' }]); | ||
} | ||
@@ -49,4 +48,4 @@ if (page.title) { | ||
{ | ||
content: page.frontmatter.description, | ||
name: 'twitter:description', | ||
content: page.frontmatter.description, | ||
}, | ||
@@ -59,4 +58,4 @@ ]); | ||
{ | ||
content: page.frontmatter.image, | ||
name: 'twitter:image', | ||
content: page.frontmatter.image, | ||
}, | ||
@@ -68,3 +67,3 @@ ]); | ||
'meta', | ||
{ name: 'twitter:image', content: '/hero-preview.png' }, | ||
{ content: '/hero-preview.png', name: 'twitter:image' }, | ||
]); | ||
@@ -78,2 +77,3 @@ } | ||
}, | ||
name: 'vuepress-plugin-open-graph', | ||
}); |
{ | ||
"name": "vuepress-plugin-open-graph", | ||
"description": "VuePress plugin for generating open graph meta tags", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"type": "module", | ||
@@ -30,4 +30,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@vuepress/core": "2.0.0-beta.62" | ||
"@vuepress/core": "2.0.0-beta.63" | ||
} | ||
} |
+ Added@vuepress/client@2.0.0-beta.63(transitive)
+ Added@vuepress/core@2.0.0-beta.63(transitive)
+ Added@vuepress/markdown@2.0.0-beta.63(transitive)
+ Added@vuepress/shared@2.0.0-beta.63(transitive)
+ Added@vuepress/utils@2.0.0-beta.63(transitive)
- Removed@vuepress/client@2.0.0-beta.62(transitive)
- Removed@vuepress/core@2.0.0-beta.62(transitive)
- Removed@vuepress/markdown@2.0.0-beta.62(transitive)
- Removed@vuepress/shared@2.0.0-beta.62(transitive)
- Removed@vuepress/utils@2.0.0-beta.62(transitive)
Updated@vuepress/core@2.0.0-beta.63