Authored by 张孝茹

new seo

@@ -24,6 +24,15 @@ const channelToAppChannel = (channel) => { @@ -24,6 +24,15 @@ const channelToAppChannel = (channel) => {
24 }[channel] || '1'; 24 }[channel] || '1';
25 }; 25 };
26 26
  27 +const channelSeo = (channel) => {
  28 + return {
  29 + boys: '男生',
  30 + girls: '女生',
  31 + kids: '潮童',
  32 + lifestyle: '创意生活'
  33 + }[channel] || '男生';
  34 +};
  35 +
27 // 新品到着(blk) 36 // 新品到着(blk)
28 const blkNewGoods = (req, res, next) => { 37 const blkNewGoods = (req, res, next) => {
29 let params = Object.assign({ 38 let params = Object.assign({
@@ -76,8 +85,9 @@ const newGoods = (req, res, next) => { @@ -76,8 +85,9 @@ const newGoods = (req, res, next) => {
76 res.render('new/new', { 85 res.render('new/new', {
77 module: 'product', 86 module: 'product',
78 page: 'new', 87 page: 'new',
79 -  
80 - // title: '新品到着', 88 + title: channelSeo(req.yoho.channel) + '新品上架,100%正品保证-YOHO!BUY 有货',
  89 + keywords: channelSeo(req.yoho.channel) + '新品,潮流新品,潮流正品',
  90 + description: channelSeo(req.yoho.channel) + '新品上架,正品网购,官方授权!100%品牌正品保证,支持货到付款。 想购买潮流商品就来YOHO! 有货中国最大的潮流商品购物网站。', // eslint-disable-line
81 pageHeader: headerModel.setNav({ 91 pageHeader: headerModel.setNav({
82 navTitle: '新品到着' 92 navTitle: '新品到着'
83 }), 93 }),
@@ -104,7 +114,7 @@ const newGoodsRedirect = (req, res) => { @@ -104,7 +114,7 @@ const newGoodsRedirect = (req, res) => {
104 if (param) { 114 if (param) {
105 param = '?' + param; 115 param = '?' + param;
106 } 116 }
107 - res.redirect(301, `/product/${req.yoho.channel}-new/${param}`); 117 + res.redirect(301, `/${req.yoho.channel}-new/${param}`);
108 }; 118 };
109 119
110 /** 120 /**
@@ -71,6 +71,22 @@ module.exports = () => { @@ -71,6 +71,22 @@ module.exports = () => {
71 req.url = `/product/${req.url}`; 71 req.url = `/product/${req.url}`;
72 } 72 }
73 73
  74 + if (/^\/boy-new/.test(req.url)) {
  75 + req.url = '/product/boys-new/';
  76 + }
  77 +
  78 + if (/^\/girls-new/.test(req.url)) {
  79 + req.url = '/product/girls-new/';
  80 + }
  81 +
  82 + if (/^\/kids-new/.test(req.url)) {
  83 + req.url = '/product/kids-new/';
  84 + }
  85 +
  86 + if (/^\/lifestyle-new/.test(req.url)) {
  87 + req.url = '/product/lifestyle-new/';
  88 + }
  89 +
74 next(); 90 next();
75 }; 91 };
76 }; 92 };