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

Regression: package.json name is used as title in titleTemplate #387

Closed
trygveaa opened this issue Oct 29, 2020 · 3 comments
Closed

Regression: package.json name is used as title in titleTemplate #387

trygveaa opened this issue Oct 29, 2020 · 3 comments

Comments

@trygveaa
Copy link

As of version 3.1.0 if a page doesn't specify a title, the name from package.json is used in the titleTemplate config in the head config, either as the %s placeholder or the argument sent to the function. Previously, an empty string was used.

The reason this is a problem is that we have this function as the titleTemplate:

titleTemplate: (titleChunk) =>
  (titleChunk ? `${titleChunk} | ` : '') + 'App name'

Which allows us to have "Sub page | App name" if a page specifies "Sub page" as the title, and just "App name" if a page doesn't specify a title. Now "name from package.json | App name" is used instead.

This was changed in #363. Is this change intentional?

Copy link
Member

farnabaz commented Mar 5, 2021

Module uses package name as a fallback for page title, to clear default fallback title you can set pwa.meta.name = '' in nuxt.config.js

export default {
  pwa: {
    meta: {
      title: ''
    }
  }
}

@trygveaa
Copy link
Author

Hm, that didn't work for me, but setting head.title = '' seems to work. Thanks.

@alejandroyunes
Copy link

I was able to remove the key name from the package.json with the titleTemplate below:

app: { head: { htmlAttrs: { lang: 'es' }, title: 'default title', titleTemplate: '%s', }, }

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