Skip to content
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

SSR's meta tags do not show up in build's <head> #11

Closed
please-wait opened this issue Apr 28, 2021 · 2 comments
Closed

SSR's meta tags do not show up in build's <head> #11

please-wait opened this issue Apr 28, 2021 · 2 comments

Comments

@please-wait
Copy link

Going to https://80shuo.com/ the html does not have <meta charset="utf-8"> or any other meta tag in HTML head, but those are specified in ssr:

<meta charset="utf-8">

Where could this issue come from?

@80maker
Copy link
Owner

80maker commented Apr 29, 2021

😮Really? You are right. But, I just view the source of html, it has the right meta tag. I think it probably caused by vuepress itself, because the site of https://vuepress.vuejs.org has this issue too.

@please-wait
Copy link
Author

please-wait commented Apr 29, 2021

A solution I found is to include the following in config.js

head: [
    ["meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }],
    ["meta", { charset:"utf-8" }]
 ]

It's not ideal because iirc these tags are recommended to be in the first 1024 characters of the file, and right now they are under a load of other tags. But a modern browser understands them just fine it appears.

Perhaps their version upgrade will fix it in the future.

@80maker 80maker closed this as completed Sep 23, 2022
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

2 participants