Make scroll to posts id a global site variable, apply id to featured hero / pagination

This commit is contained in:
Kyle Gordy 2019-12-05 10:59:28 -05:00
parent 23635f6af6
commit 80e2c41f04
4 changed files with 7 additions and 6 deletions

View File

@ -32,6 +32,7 @@ permalink: "/blog/:year/:title:output_ext"
date_format: "%B %-d, %Y"
paginate: 12
paginate_path: "/blog/page:num/"
post-id: "#posts"
# Build settings
plugins:

View File

@ -69,7 +69,7 @@
<!-- All posts button (if not on a blog page already) -->
{% unless page.url contains "blog" %}
<a href="{% link blog/index.html %}#all-posts" class="mt-4 btn btn-primary btn-icon-right">
<a href="{% link blog/index.html %}{{ site.post-id }}" class="mt-4 btn btn-primary btn-icon-right">
All Posts
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#arrow-right' | relative_url }}"></use></svg>
</a>

View File

@ -5,7 +5,7 @@
<!-- Previous arrow -->
{% if paginator.previous_page %}
<li class="pagination__item">
<a class="older-posts" href="{{ paginator.previous_page_path | relative_url }}">
<a class="pagination__link" href="{{ paginator.previous_page_path | relative_url }}{{ site.post-id }}">
<span class="visually-hidden">Previous Page</span>
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#arrow-left' | relative_url }}"></use></svg>
</a>
@ -24,13 +24,13 @@
<!-- Page 1 -->
{% if page == 1 %}
<a class="pagination__link {{ class }}" href="{{ paginator.previous_page_path | relative_url }}" {{ aria }}>
<a class="pagination__link {{ class }}" href="{{ paginator.previous_page_path | relative_url }}{{ site.post-id }}" {{ aria }}>
<span class="visually-hidden">Page </span>{{ page }}
</a>
<!-- Page 2, 3, 4, etc -->
{% else %}
<a class="pagination__link {{ class }}" href="{{ site.paginate_path | relative_url | replace: ':num', page }}" {{ aria }}>
<a class="pagination__link {{ class }}" href="{{ site.paginate_path | relative_url | replace: ':num', page }}{{ site.post-id }}" {{ aria }}>
<span class="visually-hidden">Page </span>{{ page }}
</a>
@ -41,7 +41,7 @@
<!-- Next arrow -->
{% if paginator.next_page %}
<li class="pagination__item">
<a class="older-posts" href="{{ paginator.next_page_path | relative_url }}">
<a class="pagination__link" href="{{ paginator.next_page_path | relative_url }}{{ site.post-id }}">
<span class="visually-hidden">Next Page</span>
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#arrow-right' | relative_url }}"></use></svg>
</a>

View File

@ -10,7 +10,7 @@
margin: rem-calc(0 5px 5px 0);
}
.pagination a {
.pagination__link {
display: inline-block;
padding: rem-calc(4px);
min-width: rem-calc(36px);