Feature request: Support for defaultTitle
See original GitHub issueSummary
Allow users to define a defaultTitle in gridsome.config.js
to fall back to if a metaInfo.title
is not provided in a page component.
We can look to React Helmet for reference.
Basic example
// gridsome.config.js
module.exports = {
titleTemplate: '%s \u2013 Gridsome',
defaultTitle: 'Gridsome'
}
<!-- pages/Index.vue -->
<script>
export default {
metaInfo: {
title: null,
},
}
</script>
<!-- rendered HTML -->
<head>
<title>Gridsome</title>
</head>
Motivation
This, I believe, would give users more granular control of their SEO, which is nice.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Feature Request Template: How to Manage Suggestions at ...
Streamline and organize user feedback with this free feature request template. Available in Google Docs and Sheets (no email required).
Read more >Feature Request: Support Help Section - Zendesk help
I see that when I "Get Help" from within Zendesk Support, a help bar displays where I can search HC topics before submitting...
Read more >JazzHR: Award-Winning Recruiting Software for SMBs
Find and hire the right talent, fast with the only hiring platform built for businesses like yours. Request A Demo Try it Free....
Read more >Booz Allen
As a consulting firm with expertise in analytics, digital, engineering, and cyber, we help businesses, government, and military organizations transform.
Read more >Lever: Recruiting Software for More Hiring in Less Time
We designed features like this in LeverTRM with recruiters in mind so they can build relationships and help managers hire better candidates faster....
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
Thumbs up for
titleTemplate
accepting a function as suggested by @thasmo, it should also provide the config as context:titleTemplate: ({title, config}) => {}
.I would open a PR if the feature is accepted, but I am a little bit sceptical judging the amount of unnatended ones so far 😦
Chiming in on this topic 'cause I’ve trouble configuring a proper per-page-title in combination with a configured site wide title and maybe my issue/requirements can benefit how the solution for this issue looks like.
In my case I want to define a site title and a per-page-title. I thought I could do it like this:
gridsome.config.js
Index.vue
About.vue
I expected the final page’s title to be
SITE
for theIndex.vue
page andABOUT - SITE
for theAbout.vue
page but it turns out, that it works differently and I’m not sure how I can handle this.Optimally I can define a global
titleTemplate
for the whole application and configure atitle
per page, which gets used within thetitleTemplate
. It seemstitle
completely overwrites thetitleTemplate
or something.