From 8b634c210d1fb0ccfe7e1172242b9771b374efa8 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Tue, 23 Jan 2018 18:30:36 +0800 Subject: [PATCH 1/2] feat: add noscript in head --- examples/meta-info/pages/index.vue | 3 +++ lib/core/meta.js | 3 ++- lib/core/renderer.js | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/meta-info/pages/index.vue b/examples/meta-info/pages/index.vue index 84b1fc33b9..4e14608b6d 100755 --- a/examples/meta-info/pages/index.vue +++ b/examples/meta-info/pages/index.vue @@ -12,6 +12,9 @@ export default { meta: [ { hid: 'description', name: 'description', content: 'Home page description' } ], + noscript: [ + { innerHTML: 'Body No Scripts', body: true } + ], script: [ { src: '/head.js' }, // Supported since 1.0 diff --git a/lib/core/meta.js b/lib/core/meta.js index abc4017975..702338cc92 100644 --- a/lib/core/meta.js +++ b/lib/core/meta.js @@ -58,7 +58,8 @@ module.exports = class MetaRenderer { m.script.text() + m.noscript.text() // BODY_SCRIPTS - meta.BODY_SCRIPTS = m.script.text({ body: true }) + meta.BODY_SCRIPTS = m.script.text({ body: true }) + + m.noscript.text({ body: true }) // Resources Hints meta.resourceHints = '' // Resource Hints diff --git a/lib/core/renderer.js b/lib/core/renderer.js index 4b05dd5fec..aad3d38921 100644 --- a/lib/core/renderer.js +++ b/lib/core/renderer.js @@ -373,6 +373,7 @@ module.exports = class Renderer { APP += `` APP += context.renderScripts() APP += m.script.text({ body: true }) + APP += m.noscript.text({ body: true }) HEAD += context.renderStyles() From d0e011bdc48c4aae9402fcd152030cb02718ff9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Tue, 23 Jan 2018 11:42:25 +0100 Subject: [PATCH 2/2] Update meta.js --- lib/core/meta.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/core/meta.js b/lib/core/meta.js index 702338cc92..28af4a63a9 100644 --- a/lib/core/meta.js +++ b/lib/core/meta.js @@ -58,8 +58,7 @@ module.exports = class MetaRenderer { m.script.text() + m.noscript.text() // BODY_SCRIPTS - meta.BODY_SCRIPTS = m.script.text({ body: true }) + - m.noscript.text({ body: true }) + meta.BODY_SCRIPTS = m.script.text({ body: true }) + m.noscript.text({ body: true }) // Resources Hints meta.resourceHints = '' // Resource Hints