From 8d630908002b53bdcf6ab05036d050bdc5c7d274 Mon Sep 17 00:00:00 2001 From: Quinn Daley Date: Fri, 12 Jan 2024 18:03:42 +0000 Subject: [PATCH 1/6] Add title_on_all_pages option --- _config.yml | 2 ++ _includes/head.html | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 27eeffa52b17..38a850799b5e 100644 --- a/_config.yml +++ b/_config.yml @@ -11,6 +11,8 @@ # Name of website title: My Website +# Show the site title in the of all pages in addition to the page title +title_on_all_pages: false # Your name to show in the footer author: Some Person diff --git a/_includes/head.html b/_includes/head.html index 679c95e07eca..b5e253b8411f 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_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 }} From 6c39406c8e49ce4e8d43048dda8ff0472181f83b Mon Sep 17 00:00:00 2001 From: Quinn Daley <quinn@fishpercolator.co.uk> Date: Sat, 20 Jan 2024 12:00:33 +0000 Subject: [PATCH 2/6] Respond to code review --- _config.yml | 4 ++-- _includes/head.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_config.yml b/_config.yml index 38a850799b5e..9007cdc726a5 100644 --- a/_config.yml +++ b/_config.yml @@ -10,9 +10,9 @@ ############################ # Name of website -title: My 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 +title-on-all-pages: true # Your name to show in the footer author: Some Person diff --git a/_includes/head.html b/_includes/head.html index b5e253b8411f..55a3190398e2 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -13,7 +13,7 @@ {% endcapture %} {% capture title %} - {%- if site.title_on_all_pages and (site.title != pagetitle) -%} + {%- if site.title and site.title-on-all-pages and (site.title != pagetitle) -%} {{ pagetitle }} | {{ site.title }} {%- else -%} {{ pagetitle }} From 98d4ab09d6b0eec398b80eb80459b7b6a552a0a9 Mon Sep 17 00:00:00 2001 From: Dean Attali <dean@attalitech.com> Date: Sat, 20 Jan 2024 17:21:38 -0500 Subject: [PATCH 3/6] add extra blank line --- _config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_config.yml b/_config.yml index 9007cdc726a5..cfea8c60dc36 100644 --- a/_config.yml +++ b/_config.yml @@ -11,6 +11,7 @@ # 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: true From 76c19dab47e908696b8cc83039f934b2fdc926a3 Mon Sep 17 00:00:00 2001 From: Dean Attali <dean@attalitech.com> Date: Sat, 20 Jan 2024 17:22:52 -0500 Subject: [PATCH 4/6] move title-on-all-pages to not be the most important field --- _config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_config.yml b/_config.yml index cfea8c60dc36..baad78a39e9c 100644 --- a/_config.yml +++ b/_config.yml @@ -12,9 +12,6 @@ # 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: true - # Your name to show in the footer author: Some Person @@ -103,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 <title> 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 From 0487be1150e8e040157729ddc4c8ab4923305f24 Mon Sep 17 00:00:00 2001 From: Dean Attali <dean@attalitech.com> Date: Sat, 20 Jan 2024 17:25:28 -0500 Subject: [PATCH 5/6] add entry in CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73790ce4a0ca..2c3f63e3b635 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 ## v6.0.1 (2023-06-08) From 9dc85f640f6c038b4e6ded051e038fc52461064e Mon Sep 17 00:00:00 2001 From: Dean Attali <dean@attalitech.com> Date: Sat, 20 Jan 2024 17:26:37 -0500 Subject: [PATCH 6/6] add pr number to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c3f63e3b635..6f229cab3547 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +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 +- Added `title-on-all-pages` config setting, that adds the website title to all page titles (#1272) ## v6.0.1 (2023-06-08)