0

I have a vue.js project, when I put it's URL in some App, I think it should be show the title and description below message box.

but it was show content of noscript tags, why?

I think I set title and description in my vue.js page correct, I used vue-meta package.

enter image description here

This is what shown in LINE, I want the title show in first line, and description show in second line.

enter image description here

And this is what shown in Instegram. Also, I think the first should be show the page title, but it's not.

enter image description here

3
  • Those services just fetch the initial HTML, they don't execute the Javascript in it. Commented Aug 20, 2021 at 7:15
  • how do I set the title and description in initial HTML? Commented Aug 20, 2021 at 7:26
  • On server side. These are the basics of SEO. If you're not sure a robot is able to render your scripts, you need to provide as much static HTML as needed. You can use Vue SSR or any other server rendering to produce meta in HTML. Commented Aug 20, 2021 at 7:46

1 Answer 1

1

As @deceze already pointed out in the comments, services that try fetching a title and description for a website only fetch the initial HTML and don't execute JavaScript during the process. The vue-meta package, however, sets the title and meta tags only when executing JavaScript.

Assuming you are using vue-cli, there should be a file public/index.html, that is served as the initial HTML when requesting your application. In that file, you can easily adjust the <title> tag and add some <meta> tags to the <head> of the page.

You can also have a look at the Vue CLI documentation about the index.html file: https://cli.vuejs.org/guide/html-and-static-assets.html#the-index-file.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I set the title and description in index.html, it's work!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.