Vuepress: Ability to alter meta viewport

Created on 16 Sep 2018  路  4Comments  路  Source: vuejs/vuepress


Feature request

Halo, I am working in amp, found <meta name="viewport" content="width=device-width,initial-scale=1"> can not be overwritten, I hope this can be done in next version,
thanks


What problem does this feature solve?

What does the proposed API look like?

How should this be implemented in your opinion?

Are you willing to work on this yourself?**

Most helpful comment

For any strangers, who try to set viewport: just add it to config.js -> head, e.g.

module.exports = (ctx) => ({
  head: [
    ['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1' }],
  ],
...

All 4 comments

It can be overwritten by adding a new meta array in config.js. Then it will appear two <viewport> tag in your html <head> tag, the latter one will overwrite the previous one.

wait, maybe I miss something in the docs about meta inside config.js
if you meant head options in config.js, yes it produce duplicate meta viewport that invalid in amp

can be resolved with #733

For any strangers, who try to set viewport: just add it to config.js -> head, e.g.

module.exports = (ctx) => ({
  head: [
    ['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1' }],
  ],
...
Was this page helpful?
0 / 5 - 0 ratings

Related issues

AleksejDix picture AleksejDix  路  3Comments

higuoxing picture higuoxing  路  3Comments

shaodahong picture shaodahong  路  3Comments

sankincn picture sankincn  路  3Comments

alinnert picture alinnert  路  3Comments