Skip to content

Commit ce74f8d

Browse files
committed
Remove paginated blog pages from the sidebar
The additional pages of posts ("page2", "page3", etc.) were being included in the sidebar incorrectly. Only the first page of most recent posts should be linked to, all other pages should be linked from the "older" and "newer" buttons on the blog page.
1 parent 3b127b5 commit ce74f8d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

_includes/sidebar.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ <h1>
2121
{% for node in pages_list %}
2222
{% if node.title != null %}
2323
{% if node.layout == "page" %}
24-
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ node.url }}">{{ node.title }}</a>
24+
{% if node.url contains "page" %}
25+
{% comment %} Paginated Blog pages should not be included in the sidebar. {% endcomment %}
26+
{% else %}
27+
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ node.url }}">{{ node.title }}</a>
28+
{% endif %}
2529
{% endif %}
2630
{% endif %}
2731
{% endfor %}

0 commit comments

Comments
 (0)