From 3a496a82dcaf25ca35902cee7c4a865449e3ec90 Mon Sep 17 00:00:00 2001 From: Rico Dittrich Date: Sat, 22 Jun 2019 10:17:10 +0200 Subject: [PATCH 1/2] Use relative_url Liquid filter Instead of manually constructing the correct relative URL using the site.baseurl setting, all files now use the relative_url Liquid filter wihch is less error-prone than doing it manually. --- 404.html | 2 +- _includes/category-links.html | 2 +- _includes/copyright.html | 2 +- _includes/favicons.html | 4 ++-- _includes/head.html | 4 ++-- _includes/page-links.html | 2 +- _includes/pagination-newer.html | 2 +- _includes/pagination-older.html | 2 +- _includes/post-meta.html | 2 +- _includes/post-tags.html | 2 +- _includes/related_posts.html | 2 +- _includes/search-form.html | 2 +- _includes/sidebar-icon-links.html | 6 +++--- _includes/sidebar-nav-links.html | 4 ++-- _includes/sidebar.html | 2 +- _includes/tags-list.html | 2 +- _layouts/category.html | 2 +- _layouts/index.html | 4 ++-- 18 files changed, 24 insertions(+), 24 deletions(-) diff --git a/404.html b/404.html index 9703ba819b..b6101e2ea6 100644 --- a/404.html +++ b/404.html @@ -6,5 +6,5 @@

404: Page not found

-

Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.

+

Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.

diff --git a/_includes/category-links.html b/_includes/category-links.html index 1a7da78621..961189db25 100644 --- a/_includes/category-links.html +++ b/_includes/category-links.html @@ -6,7 +6,7 @@ {% if node.title != null %} {% if node.layout == "category" %} {{ node.title }} + href="{{ node.url | relative_url }}">{{ node.title }} {% endif %} {% endif %} {% endfor %} \ No newline at end of file diff --git a/_includes/copyright.html b/_includes/copyright.html index a047394a72..0905930f07 100644 --- a/_includes/copyright.html +++ b/_includes/copyright.html @@ -1,4 +1,4 @@

© {{ site.time | date: '%Y' }}. - MIT License. + MIT License.

diff --git a/_includes/favicons.html b/_includes/favicons.html index ed424f318b..a16f8338db 100644 --- a/_includes/favicons.html +++ b/_includes/favicons.html @@ -1,2 +1,2 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 128bdc722e..5bf4b77b88 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -17,14 +17,14 @@ {% include google-analytics.html %} - + {% include font-includes.html %} {% include favicons.html %} - + {% include custom-head.html %} diff --git a/_includes/page-links.html b/_includes/page-links.html index 0e10b28bae..c451433ffb 100644 --- a/_includes/page-links.html +++ b/_includes/page-links.html @@ -7,7 +7,7 @@ {% if node.title != null %} {% if node.sidebar_link %} {{ node.title }} + href="{{ node.url | relative_url }}">{{ node.title }} {% endif %} {% endif %} {% endfor %} diff --git a/_includes/pagination-newer.html b/_includes/pagination-newer.html index 15379ed70a..8eab7a7870 100644 --- a/_includes/pagination-newer.html +++ b/_includes/pagination-newer.html @@ -1,7 +1,7 @@ {% if paginator.previous_page %} diff --git a/_includes/pagination-older.html b/_includes/pagination-older.html index e7a73a4838..e7e121f21d 100644 --- a/_includes/pagination-older.html +++ b/_includes/pagination-older.html @@ -1,7 +1,7 @@ {% if paginator.next_page %} diff --git a/_includes/post-meta.html b/_includes/post-meta.html index a34238f967..e086c8576f 100644 --- a/_includes/post-meta.html +++ b/_includes/post-meta.html @@ -18,7 +18,7 @@ {% endfor %} {% if category_page %} - + {{ category_page.title | default: category_page.category }} {% else %} diff --git a/_includes/post-tags.html b/_includes/post-tags.html index a53232d96e..9e03c9ded8 100644 --- a/_includes/post-tags.html +++ b/_includes/post-tags.html @@ -11,7 +11,7 @@
{% for tag in include.post.tags %} {% if tags_page %} - + {% else %}{% endif %} {% include svg/tags.svg %} diff --git a/_includes/related_posts.html b/_includes/related_posts.html index 1154521039..3583125241 100644 --- a/_includes/related_posts.html +++ b/_includes/related_posts.html @@ -4,7 +4,7 @@

Related Posts

{% for post in site.related_posts limit:3 %}
  • - + {{ post.title }} {{ post.date | date_to_string }} diff --git a/_includes/search-form.html b/_includes/search-form.html index 46b216880c..a32074e1f7 100644 --- a/_includes/search-form.html +++ b/_includes/search-form.html @@ -10,7 +10,7 @@ {% assign url = url | replace_first: 'spdy://', '' %} {% assign url = url | replace_first: '//', '' %} + value="{{ url }}{{ "/" | relative_url }}" />

  • diff --git a/_includes/sidebar-icon-links.html b/_includes/sidebar-icon-links.html index 650378d2f1..10efc8677b 100644 --- a/_includes/sidebar-icon-links.html +++ b/_includes/sidebar-icon-links.html @@ -14,7 +14,7 @@ + href="{{ site.feed.path | default: 'feed.xml' | relative_url }}"> {% include svg/feed.svg %} @@ -35,7 +35,7 @@ + href="{{ tags_page.url | relative_url }}"> {% include svg/tags.svg %} {% endif %} @@ -44,7 +44,7 @@ + href="{{ search_page.url | relative_url }}"> {% include svg/search.svg %} {% endif %} diff --git a/_includes/sidebar-nav-links.html b/_includes/sidebar-nav-links.html index d50b689c05..fa08823393 100644 --- a/_includes/sidebar-nav-links.html +++ b/_includes/sidebar-nav-links.html @@ -1,11 +1,11 @@