diff --git a/CHANGELOG.md b/CHANGELOG.md index 73790ce4a0ca..6f229cab3547 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Added instructions and example on how to fix image links in project sites (#1171) - Pagination buttons: use nicer arrows, and don't show text on small screens (#1221) - Updated Yelp URL format - if you previously used the `yelp` social network config parameter, you might need to update the config value (#1259) +- Added `title-on-all-pages` config setting, that adds the website title to all page titles (#1272) ## v6.0.1 (2023-06-08) diff --git a/_config.yml b/_config.yml index 27eeffa52b17..baad78a39e9c 100644 --- a/_config.yml +++ b/_config.yml @@ -10,7 +10,7 @@ ############################ # Name of website -title: My Website +title: My website # Your name to show in the footer author: Some Person @@ -100,6 +100,9 @@ share-links-active: # Remove this if you don't want a link in the footer url-pretty: "MyWebsite.com" +# Show the site title in the of all pages in addition to the page title +title-on-all-pages: true + # Excerpt word length - Truncate the excerpt of each post on the feed page to the specified number of words excerpt_length: 50 diff --git a/_includes/head.html b/_includes/head.html index 679c95e07eca..55a3190398e2 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> - {% capture title %} + {% capture pagetitle %} {%- if page.share-title -%} {{ page.share-title | strip_html | xml_escape }} {%- elsif page.title -%} @@ -12,6 +12,14 @@ {%- endif -%} {% endcapture %} + {% capture title %} + {%- if site.title and site.title-on-all-pages and (site.title != pagetitle) -%} + {{ pagetitle }} | {{ site.title }} + {%- else -%} + {{ pagetitle }} + {%- endif -%} + {% endcapture %} + {% capture description %} {%- if page.share-description -%} {{ page.share-description | strip_html | xml_escape }}