-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract page list creation & fix breadcrumb buttons.
- Loading branch information
1 parent
96cc8b1
commit e7d1780
Showing
4 changed files
with
64 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,22 @@ | ||
<footer> | ||
{%- comment -%} | ||
Jekyll doesn't offer a way to see if there are next or previous pages, it' | ||
only available for posts. So we will iterate through the pages like we do | ||
on the navigation bar and store the previous and next URLS. | ||
{%- endcomment -%} | ||
{%- assign previous_page = false -%} | ||
{%- assign next_page = false -%} | ||
{%- assign nav = site.pages | sort:"nav_order" -%} | ||
{%- assign found = false -%} | ||
|
||
{%- for nav_item in nav -%} | ||
{%- if nav_item.hide != true and nav_item.nav_exclude != true -%} | ||
{%- if nav_item.url == page.url -%} | ||
{%- assign found = true -%} | ||
{% break %} | ||
{%- else -%} | ||
{%- assign previous_page = nav_item -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if found == false -%} | ||
{%- assign previous_page = false -%} | ||
{%- endif -%} | ||
|
||
{%- assign found = false -%} | ||
{%- for nav_item in nav reversed -%} | ||
{%- if nav_item.hide != true and nav_item.nav_exclude != true -%} | ||
{%- if nav_item.url == page.url -%} | ||
{%- assign found = true -%} | ||
{% break %} | ||
{%- else -%} | ||
{%- assign next_page = nav_item -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if found == false -%} | ||
{%- assign next_page = false -%} | ||
{%- endif -%} | ||
|
||
{% if (site.prev_next_buttons_location == 'bottom' or site.prev_next_buttons_location =='both') and (previous_page or next_page) %} | ||
{%- include paginationlist.html %} | ||
{%- if (site.prev_next_buttons_location == 'bottom' or site.prev_next_buttons_location =='both') and (previous_page or next_page) %} | ||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> | ||
{% if next_page %} | ||
{%- if next_page %} | ||
<a href="{{ next_page.url | url }}" class="btn btn-neutral float-right" title="{{ next_page.title }}">Next <span class="icon icon-circle-arrow-right"></span></a> | ||
{% endif %} | ||
{% if previous_page %} | ||
{%- endif %} | ||
{%- if previous_page %} | ||
<a href="{{ previous_page.url | url }}" class="btn btn-neutral" title="{{ previous_page.title }}"><span class="icon icon-circle-arrow-left"></span> Previous</a> | ||
{% endif %} | ||
{%- endif %} | ||
</div> | ||
{% endif %} | ||
{%- endif %} | ||
|
||
<hr/> | ||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<!-- Copyright etc --> | ||
{% if site.site_author %} | ||
<p>© Copyright {{ site.time | date: "%Y" }} {{ site.site_author }}.</p> | ||
{% endif %} | ||
</div> | ||
|
||
Built with <a href="https://jekyllrb.com/">Jekyll</a> using a <a href="https://github.com/carlosperate/jekyll-theme-rtd">theme</a> based on <a href="https://readthedocs.org">Read the Docs</a>. | ||
<div role="contentinfo"> | ||
{%- if site.site_author %} | ||
<p>© Copyright {{ site.time | date: "%Y" }} {{ site.site_author }}.</p> | ||
{%- endif %} | ||
</div> | ||
Built with <a href="https://jekyllrb.com/">Jekyll</a> using a <a href="https://github.com/carlosperate/jekyll-theme-rtd">theme</a> based on <a href="https://readthedocs.org">Read the Docs</a>. | ||
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
{%- comment -%} | ||
Jekyll doesn't offer a way to see if there are next or previous pages, it' | ||
only available for posts. So we will iterate through the pages like we do | ||
on the navigation bar and store the previous and next URLS. | ||
{%- endcomment -%} | ||
{%- assign previous_page = false -%} | ||
{%- assign next_page = false -%} | ||
{%- assign nav = site.pages | sort:"nav_order" -%} | ||
{%- assign found = false -%} | ||
|
||
{%- for nav_item in nav -%} | ||
{%- if nav_item.hide != true and nav_item.nav_exclude != true -%} | ||
{%- if nav_item.url == page.url -%} | ||
{%- assign found = true -%} | ||
{% break %} | ||
{%- else -%} | ||
{%- assign previous_page = nav_item -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if found == false -%} | ||
{%- assign previous_page = false -%} | ||
{%- endif -%} | ||
|
||
{%- assign found = false -%} | ||
{%- for nav_item in nav reversed -%} | ||
{%- if nav_item.hide != true and nav_item.nav_exclude != true -%} | ||
{%- if nav_item.url == page.url -%} | ||
{%- assign found = true -%} | ||
{% break %} | ||
{%- else -%} | ||
{%- assign next_page = nav_item -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if found == false -%} | ||
{%- assign next_page = false -%} | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters