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

<title> tag is not generated correctly (especially in a custom theme) #450

Closed
johndigital opened this issue May 15, 2018 · 3 comments
Closed

Comments

@johndigital
Copy link

johndigital commented May 15, 2018

When using a custom theme and running the build command, the generated files don't have the correct <title> and <meta> description tags. This seems to also be an issue using the default theme as well, but it's worse with any custom theme.

Here is a repo to help replicate: https://github.com/johndigital/vuepress-title-issue

The master branch shows the primary issue with a minimal configuration, alternately here are the steps to replicate:

  1. npm install vuepress -g
  2. echo '# Hello VuePress' > README.md
  3. create .vuepress/config.js and paste the following config into it:
module.exports = {
    title: 'Title from config.js',
    description: 'Description from config.js'
}
  1. vuepress build

In the generated files, the title of 404.html is "VuePress" but I would expect it to be the default "Title from config.js". In this scenario since we are using the default theme the title of index.html is correct.

  1. create .vuepress/theme/Layout.vue and paste the following minimal layout from the guide:
<template>
  <div class="theme-container">
    <Content/>
  </div>
</template>
  1. vuepress build

The title of both index.html and 404.html in the /dist folder are now set to just "VuePress" rather than the title from the README file or the title from the configuration. The description is also set to an empty string rather than using the description from config.js

This appears to be an issue both when using a global or local installation of vuepress. As demonstrated in the replication repo, the frontmatter titles are ignored as well.

Please let me know if there is other information I can provide to help get this fixed. Per the bug reporting guides, here is all the relevant information about my system:

  • Your OS: OSX 10.13.4
  • Node.js version: 8.11.1
  • VuePress version: 0.8.4
  • Browser version: N/A
  • Is this a global or local install: Either
  • Which package manager did you use for the install: NPM
@ulivz
Copy link
Member

ulivz commented May 15, 2018

It has been fixed at fcaee80, and will release at 0.9.0 (#419)

@ulivz ulivz closed this as completed May 15, 2018
@ulivz ulivz added the 0.9.0 label May 15, 2018
@johndigital
Copy link
Author

Amazing, thank you @ulivz!

@jpvajda
Copy link

jpvajda commented Feb 4, 2019

@johndigital I saw you resolved this problem and I'm having the exact same problem as specified in #1232 I can't seem to get this to work and thought I'd see if you had to take any additional steps. If you could share any tips, it would be appreciated. I've tried everything I can think of to get this to work, and I can't determine the problem.

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