Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

Facebook网页分享标记

meta标签规范

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

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

<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

$ npm install vue-meta --save
import Vue from 'vue'
import Meta from 'vue-meta'

Vue.use(Meta)
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: '' }
        ]
      }
    }
  }
}
上一篇 微信官方轻量级键值对存储框架MMKV
下一篇 Android接入Facebook登录踩坑记录