Facebook网页分享标记

meta标签规范

参考:https://developers.facebook.com/docs/sharing/webmasters
分享调试:https://developers.facebook.com/tools/debug/

标记示例:如使用 og:type="article" 和多个附加属性标记文章、动态消息或博文

1
2
3
4
5
<meta property="og:url"            content="http://www.nytimes.com/2015/02/19/arts/international/when-great-minds-dont-think-alike.html" />
<meta property="og:type" content="article" />
<meta property="og:title" content="When Great Minds Don’t Think Alike" />
<meta property="og:description" content="How much does culture influence creative thinking?" />
<meta property="og:image" content="http://static01.nyt.com/images/2015/02/19/arts/international/19iht-btnumbers19A/19iht-btnumbers19A-facebookJumbo-v2.jpg" />

Vue.js中动态设置meta标签

参考:https://github.com/declandewet/vue-meta

1
$ npm install vue-meta --save
1
2
3
4
import Vue from 'vue'
import Meta from 'vue-meta'

Vue.use(Meta)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export default {
name: 'bargain',
data () {
metaInfo: {
meta: [
{ property: 'og:url', content: '' },
{ property: 'og:type', content: 'article' },
{ property: 'og:title', content: '' },
{ property: 'og:description', content: '' },
{ property: 'og:image', content: '' },
{ property: 'fb:app_id', content: '' }
]
}
}
}
}

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :