-
-
Notifications
You must be signed in to change notification settings - Fork 15.7k
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
Add a title-on-all-pages site option #1272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I like it. Please remove the changes related to the jekyll version
_includes/head.html
Outdated
@@ -12,6 +12,14 @@ | |||
{%- endif -%} | |||
{% endcapture %} | |||
|
|||
{% capture title %} | |||
{%- if site.title_on_all_pages and (site.title != pagetitle) -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also check here that site.title
exists. Someone who doesn't use this config.yml file might not have a title parameter.
_config.yml
Outdated
@@ -11,6 +11,8 @@ | |||
|
|||
# Name of website | |||
title: My Website | |||
# Show the site title in the <title> of all pages in addition to the page title | |||
title_on_all_pages: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming convention for field names in this file is title-on-all-pages
6224df6
to
8d63090
Compare
Hi @daattali - thank you for your support and your review! I've made those requested changes now and unmarked this as draft. I hope you don't mind - I also changed site.title in your example app to match the page.title of the homepage (it was only a case difference) - that makes it easier for people to see how this works. CI is still passing in my env so hopefully it should be good to go! |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Looks good, thanks! I made small changes and added to changelog. |
This PR adds a site option called
title_on_all_pages
- it adds thesite.title
to the end of all page titles (separated by|
), unless thesite.title
andtitle
are the same string (usually on home pages).This still contains my commit from #1270 but if you like the idea, and the variable name, I'll tidy it up and remove that commit before you accept it. No worries if you don't want this option in your theme!