How can I display my Site Title alone as the Title for my homepage?
This is the most trivial thing, however, I have a homepage set with the metadata: Permalink: /
and no matter whether or not I include (blank) Title:
metadata, the page's title (in a browser tab) displays as '- [Site Title]'.
All my other pages display as '[Page Title] - [Site Title]', so I get that this is the page looking for a page title, not finding one, but leaving in the hyphen delimiter. Is there a way to stop it doing that, and just display the [Site Title]?
I can do it site wide by taking the '>' out of this line in head.html: <title>{{> title}}</title>
, but that makes the title of every other page look weird.
Any and all suggestions appreciated.
This is a good question, and the answer is a little complicated. You will want to edit the partial template title
for the template file entry.html.
This partial is defined in your template's package.json file. Here is the line you would want to edit for the Diary template. Instead of this:
{{{entry.title}}} - {{{title}}}
Try this instead:
{{#entry.title}}{{{entry.title}}} -{{/entry.title}} {{{title}}}
The change basically says: only show the hyphen and the entry's title if it the entry's title exists.
Does that fix the issue?
Answered 3 years ago · Edit answerLike an absolute charm! No more shall that rogue hyphen besmirch my homepage title bar. Thanks so much for this answer.
Answered 3 years ago · Edit answer