Skip to content

Ability to alter meta viewport #845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ekoeryanto opened this issue Sep 16, 2018 · 4 comments
Closed

Ability to alter meta viewport #845

ekoeryanto opened this issue Sep 16, 2018 · 4 comments

Comments

@ekoeryanto
Copy link
Contributor

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?**

@ItsRyanWu
Copy link

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.

@ekoeryanto
Copy link
Contributor Author

ekoeryanto commented Sep 17, 2018

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

@ekoeryanto
Copy link
Contributor Author

can be resolved with #733

@b0g3r
Copy link

b0g3r commented May 11, 2020

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' }],
  ],
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants