Authored by 郝肖肖

'结构化数据百度'

... ... @@ -307,12 +307,12 @@ const index = (req, res, next) => {
isShare: isShare,
id: id,
showAnaJson: {
mipsite: true,
miptitle: data.title,
mipPublishTime: guang.detail.publishTime,
mipPic: mipPic,
mipDes: guang.shareDesc,
mipUrl: `${req.protocol}://m.yohobuy.com/guang/${id}.html`
addBaiduSite: true,
title: data.title,
publishTime: guang.detail.publishTime,
pic: mipPic,
des: guang.shareDesc,
url: `${req.protocol}://m.yohobuy.com/guang/${id}.html`
}
}, data, parameter));
})().catch(next);
... ...
... ... @@ -216,14 +216,12 @@ const detailIndex = (req, res, next) => {
currentHref: `https://m.yohobuy.com/guang/${id}.html`
},
showAnaJson: {
mipsite: false,
miptitle: `${detail.getArticle.article_title} | Yoho!Buy有货 | 潮流购物逛不停`,
mipId: id,
mipPublishTime: mipPublishTime,
mipPic: mipPic,
mipDes: detail.getArticle.article_summary,
mipUrl: `${req.protocol}://m.yohobuy.com${req.originalUrl}`,
miphtml: `${req.protocol}://m.yohobuy.com/mip/guang/${id}.html`
addBaiduSite: false,
title: `${detail.getArticle.article_title} | Yoho!Buy有货 | 潮流购物逛不停`,
publishTime: mipPublishTime,
pic: mipPic,
des: detail.getArticle.article_summary,
url: `${req.protocol}://m.yohobuy.com${req.originalUrl}`,
}
}, data));
})().catch(next);
... ...
... ... @@ -85,12 +85,12 @@ const newDetail = {
appPath: appPath,
isMarsApp: req.yoho.isMarsApp, // 判断mars
showAnaJson: {
mipsite: true,
miptitle: title,
mipPublishTime: moment.unix(result.shelveTime).format('YYYY-MM-DDTHH:mm:ss'), // mip日期必填
mipPic: mipPic,
mipDes: description,
mipUrl: `${req.protocol}://m.yohobuy.com/product/${result.productSkn}.html`
addBaiduSite: true,
title: title,
publishTime: moment.unix(result.shelveTime).format('YYYY-MM-DDTHH:mm:ss'), // mip日期必填
pic: mipPic,
des: description,
url: `${req.protocol}://m.yohobuy.com/product/${result.productSkn}.html`
},
miniPath: helpers.urlFormat('/api/wechat/miniapp.jpg', {
miniapp_type: 0,
... ...
{{# showAnaJson}}
{{#if mipsite}}<script src="//msite.baidu.com/sdk/c.js?appid=1583402501013173"></script>{{/if}}
{{#if addBaiduSite}}<script src="//msite.baidu.com/sdk/c.js?appid=1583402501013173"></script>{{/if}}
<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "{{mipUrl}}",
"@id": "{{url}}",
"appid": "1583402501013173",
"title": "{{miptitle}}",
"title": "{{title}}",
"images": [
{{#if mipPic}}"http:{{image mipPic 750 500 1}}"{{/if}}
{{#if pic}}"http:{{image pic 750 500 1}}"{{/if}}
],
"description": "{{mipDes}}",
"pubDate": "{{mipPublishTime}}"
"description": "{{des}}",
"pubDate": "{{publishTime}}"
}
</script>
{{/showAnaJson}}
... ...