Merge branch 'feature/seo-product' into feature/seo1203
Showing
3 changed files
with
15 additions
and
11 deletions
@@ -70,13 +70,8 @@ const showMain = (req, res, next) => { | @@ -70,13 +70,8 @@ const showMain = (req, res, next) => { | ||
70 | }, nullUserInfo)).then((result)=> { | 70 | }, nullUserInfo)).then((result)=> { |
71 | return res.render('product/detail', Object.assign({ | 71 | return res.render('product/detail', Object.assign({ |
72 | module: 'product', | 72 | module: 'product', |
73 | - page: 'detail', | ||
74 | - title_more: true, | ||
75 | - title: _.get(result, 'seo.title', '') + ' | ' + SEO_SLOGAN, | ||
76 | - keywords: _.get(result, 'seo.keywords', '').replace(/~+/, ''), | ||
77 | - description_more: true, | ||
78 | - description: result.description | ||
79 | - }, result)); | 73 | + page: 'detail' |
74 | + }, result.seo, result)); | ||
80 | }).catch(next); | 75 | }).catch(next); |
81 | 76 | ||
82 | }; | 77 | }; |
@@ -1061,15 +1061,21 @@ const _getSeoByGoodsInfo = (goodsInfo, navs) => { | @@ -1061,15 +1061,21 @@ const _getSeoByGoodsInfo = (goodsInfo, navs) => { | ||
1061 | title += navs[1].name + '|'; | 1061 | title += navs[1].name + '|'; |
1062 | } | 1062 | } |
1063 | 1063 | ||
1064 | - title += goodsInfo.name + '正品 '; | 1064 | + title += goodsInfo.name + '正品 | YOHO!BUY 有货'; |
1065 | + | ||
1065 | let keywords = brandName + sortName + ',' + brandName + '官网专卖店,' + brandName + '官方授权店,' + | 1066 | let keywords = brandName + sortName + ',' + brandName + '官网专卖店,' + brandName + '官方授权店,' + |
1066 | brandName + '正品,' + brandName + '打折,' + brandName + '折扣店,' + brandName + '真品,' + brandName + '代购'; | 1067 | brandName + '正品,' + brandName + '打折,' + brandName + '折扣店,' + brandName + '真品,' + brandName + '代购'; |
1067 | - let description = !goodsInfo.shareDesc ? goodsInfo.name : goodsInfo.shareDesc; | 1068 | + |
1069 | + let description = `YOHO!BUY 有货-${brandName}官方授权店,${goodsInfo.name}图片、报价、介绍。` + | ||
1070 | + `YOHO!BUY 有货{品牌}官网专卖店提供${brandName}正品、${brandName}真品、 ${brandName}打折、${brandName}代购等。`; | ||
1071 | + | ||
1072 | + let cononicalURL = goodsInfo.productUrl; | ||
1068 | 1073 | ||
1069 | return { | 1074 | return { |
1070 | title: title, | 1075 | title: title, |
1071 | - keywords: keywords, | ||
1072 | - description: description | 1076 | + keywords: keywords.replace(/~+/, ''), |
1077 | + description: description, | ||
1078 | + cononicalURL: cononicalURL | ||
1073 | }; | 1079 | }; |
1074 | }; | 1080 | }; |
1075 | 1081 | ||
@@ -1458,6 +1464,8 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1458,6 +1464,8 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1458 | statGoodsInfo.smallSortId = result.smallSortId; | 1464 | statGoodsInfo.smallSortId = result.smallSortId; |
1459 | statGoodsInfo.soldOut = soldOut ? 1 : 0; | 1465 | statGoodsInfo.soldOut = soldOut ? 1 : 0; |
1460 | 1466 | ||
1467 | + result.productUrl = statGoodsInfo.productUrl; | ||
1468 | + | ||
1461 | // 商品的品牌信息 | 1469 | // 商品的品牌信息 |
1462 | let bandInfo = {}; | 1470 | let bandInfo = {}; |
1463 | 1471 |
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | <title>{{title}}</title> | 5 | <title>{{title}}</title> |
6 | <meta name="keywords" content="{{keywords}}"> | 6 | <meta name="keywords" content="{{keywords}}"> |
7 | <meta name="description" content="{{description}}"> | 7 | <meta name="description" content="{{description}}"> |
8 | + {{#if cononicalURL}} <link rel="cononical" href="{{cononicalURL}}"/> {{/if}} | ||
8 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | 9 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> |
9 | <meta http-equiv="cleartype" content="on"> | 10 | <meta http-equiv="cleartype" content="on"> |
10 | <meta name="apple-mobile-web-app-status-bar-style" content="black" /> | 11 | <meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
-
Please register or login to post a comment