Skip to content

Title tag for Home Page and 404 page being overwritten by VuePress #1232

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
jpvajda opened this issue Jan 26, 2019 · 2 comments
Closed

Title tag for Home Page and 404 page being overwritten by VuePress #1232

jpvajda opened this issue Jan 26, 2019 · 2 comments

Comments

@jpvajda
Copy link

jpvajda commented Jan 26, 2019

Bug report

related issue: #450

I've been searching for an answer to this problem and tried everything I could based on your documentation, but perhaps I've missed how this works. Here is the issue:

I am trying to change the title tag on the Home and 404 pages for my VuePress site.

<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>VuePress</title>
    <meta name="description" content="">

On all other pages I was easily able to accomplish this by adding the title to the front matter YAML section on each .readme page.

---
title: Documentation  
lang: en-US
---

I also changed the title for each subsequent index.html pages for both the Home and 404 pages. However the bug seems to be, for the main home page, even with setting title: in the front matter YAML:

---
home: true
title: Ethopass Docs
lang: en-US
heroImage: /hero.svg
heroText: Ethopass
tagline: Ethopass Product Documentation
---

the 404 page doesn't have a corresponding readme by default, so I just change the index page and set the the title I want to display.

With all of this done - Vuepress is overwritten as the page title when the site is built. I think I traced this down to a .JS file that resides in docs/.vuepress/dist/js that seems to be used in the build process, but it's seems odd that I need to change in the .JS file, and I'm not clear why these pages don't work like the other pages I built myself.

$title:function()
{var t=this.$page,e=this.$siteTitle,n=t.frontmatter.home?null:t.frontmatter.title||t.title;return e?n?n+" | "+e:e:n||"VuePress"},

I am just missing something here?

Version

{
  "name": "ethopass-documentation",
  "version": "1.0.0",
  "description": "Developer Documentation",
  "main": "index.js",
  "author": "kratos",
  "license": "MIT",
  "private": true,
  "scripts": {
    "start": "vuepress dev docs",
    "build": "vuepress build docs"
  },
  "dependencies": {
    "@vuepress/plugin-active-header-links": "^1.0.0-alpha.0",
    "@vuepress/plugin-search": "^1.0.0-alpha.0",
    "@vuepress/theme-default": "^1.0.0-alpha.0",
    "caniuse-db": "^1.0.30000925",
    "docsearch.js": "^2.6.2",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.2"
  },
  "devDependencies": {
    "vuepress": "^0.14.8"
  }
}

Steps to reproduce

See above for details.

What is expected?

the title tags for the home page and 404 page are not overridden by Vuepress.

What is actually happening?

the title tags for the home page and 404 page are being overridden by Vuepress.

Other relevant information

  • Your OS: MAC mojave 10.14.2
  • Node.js version: 11.2.0
  • Browser version: Chrome: Version 71.0.3578.98 (Official Build) (64-bit)
  • Is this a global or local install?: Global
  • Which package manager did you use for the install?: Yarn
@ulivz
Copy link
Member

ulivz commented Jan 29, 2019

Using metaTitle instead.

BTW, the better way to ask a question is to provide a minimal repro repo

@ulivz ulivz closed this as completed Jan 29, 2019
@jpvajda
Copy link
Author

jpvajda commented Jan 30, 2019

@ulivz unfortunately it didn't work...

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