Default title prop
See original GitHub issueIt would be nice to set a default title. Let’s say the website is Github.
I’d do (in _app.js):
<NextSeo titleTemplate="%s - Github" defaultTitle="Github" />
If there’s no title set later in the document, it would fall back to Github. If there is, it would be replaced with the title template, e.g. Blog - Github.
There’s a few nice UX wins with this, happy to expand more if they’re non-obvious.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top Results From Across the Web
title - HTML: HyperText Markup Language - MDN Web Docs
The title global attribute contains text representing advisory information related to the element it belongs to.
Read more >How to change the style of the title attribute inside an anchor ...
How do I change the presentation of the "title" attribute in the browser?. By default, it just has yellow background and small font....
Read more >HTML Global title Attribute - W3Schools
The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves...
Read more >How to Change the Style of the "title" Attribute Within ... - W3docs
Set the border-bottom and text-decoration properties for the class attribute of the <a> tag. Add the :hover pseudo-class to the class attribute of...
Read more >ServiceLink Default Title & Close | svclnk.com
Title property report and title grading. Understanding a property's lien position and resolving any title issues is critical during the loan modification ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@switz @garmeeh I just opened a PR that adds a
defaultTitleparam in the style ofreact-helmet. In short, if adefaultTitleis added, then pages with notitledefined will still get the default value.For example, let’s say I had the following in my
_app.js:My home page might look like this:
But another page in my website that doesn’t have a
titleset would still render a<title>tag with “MyApp” only.Well, I think
fallbackTitlewould make more sense for my use-case. But there may be other usecases that prefer the other. I’ll always have atitleTemplateset (in app.js), but for example, if I set title toGithubon the index page, it would returnGithub - Github(due to the title template). So if I was able to setfallbackTitlewhen there is no title set, it would negate thetitleTemplate.I believe this also has the benefit of having a preliminary title set in the case of html streaming, before the full page has rendered out, but I could be wrong, I’m not an expert in that.