diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-08 21:35:11 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-08 21:35:11 +0300 |
commit | 0b13dadaacc964ad275794f457ec587069b890e9 (patch) | |
tree | ea32d0cbd20382df53036a24686df8ceaadca84f | |
parent | paginator: add explanatory comments (diff) | |
download | jekyll-theme-0b13dadaacc964ad275794f457ec587069b890e9.tar.gz jekyll-theme-0b13dadaacc964ad275794f457ec587069b890e9.zip |
use relative_url instead of site.baseurl
-rw-r--r-- | _includes/common/header.html | 6 | ||||
-rw-r--r-- | _includes/common/navbar.html | 4 | ||||
-rw-r--r-- | _includes/common/paginator.html | 8 | ||||
-rw-r--r-- | _includes/common/sidebar.html | 2 | ||||
-rw-r--r-- | _layouts/category.html | 4 | ||||
-rw-r--r-- | _layouts/post.html | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/_includes/common/header.html b/_includes/common/header.html index d95c0a0..8abe740 100644 --- a/_includes/common/header.html +++ b/_includes/common/header.html @@ -13,12 +13,12 @@ {% include common/bootstrap_css.html %} - <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/common/footer.css"> - <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/common/misc.css"> + <link rel="stylesheet" href="{{ '/assets/css/common/footer.css' | relative_url }}"> + <link rel="stylesheet" href="{{ '/assets/css/common/misc.css' | relative_url }}"> {% if page.custom_css %} {% for css in page.custom_css %} - <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/{{ css }}"/> + <link rel="stylesheet" href="{{ '/assets/css/' | relative_url }}{{ css }}"/> {% endfor %} {% endif %} diff --git a/_includes/common/navbar.html b/_includes/common/navbar.html index 6cf0e74..8ec0812 100644 --- a/_includes/common/navbar.html +++ b/_includes/common/navbar.html @@ -21,9 +21,9 @@ {% endif %} {% if node.groups contains 'navbar' %} {% if page.url == node.url %} - <li class="active"><a href="{{ site.baseurl }}{{ node.url }}" class="active">{{ node.navbar_link }}</a></li> + <li class="active"><a href="{{ node.url | relative_url }}" class="active">{{ node.navbar_link }}</a></li> {% else %} - <li><a href="{{ site.baseurl }}{{ node.url }}">{{ node.navbar_link }}</a></li> + <li><a href="{{ node.url | relative_url }}">{{ node.navbar_link }}</a></li> {% endif %} {% endif %} {% endfor %} diff --git a/_includes/common/paginator.html b/_includes/common/paginator.html index 659ea87..471383c 100644 --- a/_includes/common/paginator.html +++ b/_includes/common/paginator.html @@ -14,7 +14,7 @@ {% endif %} <ul class="pagination"> {% if paginator.previous_page %} - <li><a href="{{ site.baseurl }}{{ paginator.previous_page_path }}"><span class="glyphicon glyphicon-chevron-left"></span> Prev</a></li> + <li><a href="{{ paginator.previous_page_path | relative_url }}"><span class="glyphicon glyphicon-chevron-left"></span> Prev</a></li> {% else %} <li class="disabled"><a href="#"><span class="glyphicon glyphicon-chevron-left"></span> Prev</a></li> {% endif %} @@ -22,13 +22,13 @@ {% if page_number == paginator.page %} <li class="active"><a href="#">{{ page_number }}</a></li> {% elsif page_number == 1 %} - <li><a href="{{ site.baseurl }}{{ page1_url }}">{{ page_number }}</a></li> + <li><a href="{{ page1_url | relative_url }}">{{ page_number }}</a></li> {% else %} - <li><a href="{{ site.baseurl }}{{ site.paginate_path | replace: ':num', page_number }}">{{ page_number }}</a></li> + <li><a href="{{ site.paginate_path | replace: ':num', page_number | relative_url }}">{{ page_number }}</a></li> {% endif %} {% endfor %} {% if paginator.next_page %} - <li><a href="{{ site.baseurl }}{{ paginator.next_page_path }}">Next <span class="glyphicon glyphicon-chevron-right"></span></a></li> + <li><a href="{{ paginator.next_page_path | relative_url }}">Next <span class="glyphicon glyphicon-chevron-right"></span></a></li> {% else %} <li class="disabled"><a href="#">Next <span class="glyphicon glyphicon-chevron-right"></span></a></li> {% endif %} diff --git a/_includes/common/sidebar.html b/_includes/common/sidebar.html index 76cced0..923eb04 100644 --- a/_includes/common/sidebar.html +++ b/_includes/common/sidebar.html @@ -14,7 +14,7 @@ {% else %} <div class="list-group wide-enough"> {% for post in site.posts limit: 5 %} - <a class="list-group-item" href="{{ site.baseurl }}{{ post.url }}"> + <a class="list-group-item" href="{{ post.url | relative_url }}"> <span class="badge"><span class="glyphicon glyphicon-time"></span> {{ post.date | date: '%-d %b %Y' }}</span> <span class="glyphicon glyphicon-file"></span> {{ post.title }} </a> diff --git a/_layouts/category.html b/_layouts/category.html index efb34db..5be0ddc 100644 --- a/_layouts/category.html +++ b/_layouts/category.html @@ -7,8 +7,8 @@ layout: default {% if site.categories[page.category].size > 0 %} <ul> {% for post in site.categories[page.category] %} - <li><a href="{{ site.baseurl }}{{ post.url }}">{{ post.date | date: "%Y-%m-%d" }} — {{ post.title }}</a></li> + <li><a href="{{ post.url | relative_url }}">{{ post.date | date: "%Y-%m-%d" }} — {{ post.title }}</a></li> {% endfor %} </ul> {% endif %} -<p>For a complete list of posts grouped by category, please see <a href="{{ site.baseurl }}/all/">this page</a>.</p> +<p>For a complete list of posts grouped by category, please see <a href="{{ '/all/' | relative_url }}">this page</a>.</p> diff --git a/_layouts/post.html b/_layouts/post.html index c539244..1af112a 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -4,7 +4,7 @@ layout: default <h1>{{ page.title }}</h1> <p class="text-muted"> <span class="glyphicon glyphicon-time"></span> Posted on {{ page.date | date: '%-d %B %Y' }} - {%- if page.category %} in <span class="glyphicon glyphicon-folder-open"></span> <a class="category" href="{{ site.baseurl }}/categories/{{ page.category | slugify: 'pretty' }}/">{{ page.category }}</a>{% endif %} + {%- if page.category %} in <span class="glyphicon glyphicon-folder-open"></span> <a class="category" href="{{ '/categories/' | relative_url }}{{ page.category | slugify: 'pretty' }}/">{{ page.category }}</a>{% endif %} </p> {{ content }} <hr/> |