From 5a02e2a79d9660e1a903c2c2f026f2cb773b49d9 Mon Sep 17 00:00:00 2001 From: ludanxer Date: Sun, 2 Feb 2020 18:15:25 +0800 Subject: [PATCH] fix: duplicate meta in ssr --- .../@vuepress/core/lib/client/index.ssr.html | 1 - .../@vuepress/core/lib/node/build/index.js | 23 ------------------- 2 files changed, 24 deletions(-) diff --git a/packages/@vuepress/core/lib/client/index.ssr.html b/packages/@vuepress/core/lib/client/index.ssr.html index 1c5e66bc8c..2dda53994f 100644 --- a/packages/@vuepress/core/lib/client/index.ssr.html +++ b/packages/@vuepress/core/lib/client/index.ssr.html @@ -7,7 +7,6 @@ {{{ userHeadTags }}} - {{{ pageMeta }}} {{{ renderResourceHints() }}} {{{ renderStyles() }}} diff --git a/packages/@vuepress/core/lib/node/build/index.js b/packages/@vuepress/core/lib/node/build/index.js index 912eca8c23..f124693ad5 100644 --- a/packages/@vuepress/core/lib/node/build/index.js +++ b/packages/@vuepress/core/lib/node/build/index.js @@ -138,14 +138,9 @@ module.exports = class Build extends EventEmitter { readline.cursorTo(process.stdout, 0) process.stdout.write(`Rendering page: ${pagePath}`) - // #565 Avoid duplicate description meta at SSR. - const meta = (page.frontmatter && page.frontmatter.meta || []).filter(item => item.name !== 'description') - const pageMeta = renderPageMeta(meta) - const context = { url: page.path, userHeadTags: this.userHeadTags, - pageMeta, title: 'VuePress', lang: 'en', description: '', @@ -225,24 +220,6 @@ function renderAttrs (attrs = {}) { } } -/** - * Render meta tags - * - * @param {Array} meta - * @returns {Array} - */ - -function renderPageMeta (meta) { - if (!meta) return '' - return meta.map(m => { - let res = ` { - res += ` ${key}="${escape(m[key])}"` - }) - return res + `>` - }).join('') -} - /** * find and remove empty style chunk caused by * https://github.com/webpack-contrib/mini-css-extract-plugin/issues/85