From 5d744b5e844e1da34b49c77c4116baccfa987c4b Mon Sep 17 00:00:00 2001 From: yi-ge Date: Mon, 20 Jul 2020 18:28:58 +0800 Subject: [PATCH] =?UTF-8?q?xml=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nuxt.config.js | 1 - pages/post/_id.vue | 22 ++++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/nuxt.config.js b/nuxt.config.js index f3814f8..a4cf62c 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -1,7 +1,6 @@ const pkg = require('./package') const DevBaseUrl = 'http://127.0.0.1:65534' -// const DevBaseUrl = 'https://api.wyr.me' const ProdBashUrl = 'https://api.wyr.me' module.exports = { diff --git a/pages/post/_id.vue b/pages/post/_id.vue index ccc4718..d04741f 100644 --- a/pages/post/_id.vue +++ b/pages/post/_id.vue @@ -10,7 +10,7 @@ |   {{ articels.post_date }} li Icon(:icon="['far', 'bookmark']") - nuxt-link(v-for='(relationships, index) in articels.term_relationships', :key='index', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug") + nuxt-link(v-for='(relationships, index) in articels.term_relationships', :key='index', v-if='relationships.term_taxonomy && relationships.term_taxonomy.term && relationships.term_taxonomy.taxonomy.category === "category"', :to="'/' + relationships.term_taxonomy.term.slug") span |   {{ relationships.term_taxonomy.term.name }} li(v-if='articels.postmetum.meta_value !== 0') @@ -585,8 +585,26 @@ export default { } }, head () { + const keywords = [] + for (let i = 0; i < this.articels.term_relationships.length; i++) { + if (this.articels.term_relationships[i].term_taxonomy && this.articels.term_relationships[i].term_taxonomy.term && this.articels.term_relationships[i].term_taxonomy.taxonomy.category === 'category') { + keywords.push(this.articels.term_relationships[i].term_taxonomy.term.name) + } + } return { - title: `${this.articels.post_title} - 轶哥` + title: `${this.articels.post_title} - 轶哥`, + meta: [ + { + hid: 'description', + name: 'description', + content: this.articels.post_excerpt + }, + { + hid: 'keywords', + name: 'keywords', + content: '轶哥,王轶,全栈,程序员,技术博客' + } + ] } } }