Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ vale <PATH/FILE>

:exclamation: make sure you are using Vale 2.16.0 or greater

#### Custom Prev/Next

To configure a page to have a different prev or next link,
add the appropriate metadata to the top of the file:

`:prev_link: <path to page>.html`
`:prev_title: < title of link, can be anything>`

For "next" use `next_link` and `next_title`.

#### Screenshots and Diagrams

Visual assets can be found in `source/_static`.
Expand Down
39 changes: 26 additions & 13 deletions source/_templates/prev-next.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
{%- if (show_prev_next == 'true') and (next or prev) %}
{#- Translators: This is an ARIA section label for the footer section of the page. -#}
<div class="rst-footer-buttons" role="navigation" aria-label="{{ _('Footer') }}">
{%- if prev %}
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p" rel="prev" data-analytics-event="cta" data-analytics-action="click" data-analytics-label="previous" data-analytics-detail="{{ prev.title|striptags|e }}" data-analytics-location="{{ prev.link|e }}"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
{%- endif %}
{%- if next %}
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n" rel="next" data-analytics-event="cta" data-analytics-action="click" data-analytics-label="next" data-analytics-detail="{{ next.title|striptags|e }}" data-analytics-location="{{ next.link|e }}">{{ _('Next') }} <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
{%- endif %}
</div>
{%- endif %}

<hr/>
{# Modified version of PyData's prev-next, checks page metadata for custom links first #}
{# Displays links to the previous and next page in the TOCtree order. #}
<div class="prev-next-area">
{%- if prev %}
<a class="left-prev"
href="{{ meta.prev_link or prev.link|e }}"
title="{{ _('previous page') }}">
<i class="fa-solid fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">{{ _("previous") }}</p>
<p class="prev-next-title">{{ meta.prev_title or prev.title }}</p>
</div>
</a>
{%- endif %}
{%- if next %}
<a class="right-next"
href="{{ meta.next_link or next.link|e }}"
title="{{ _('next page') }}">
<div class="prev-next-info">
<p class="prev-next-subtitle">{{ _("next") }}</p>
<p class="prev-next-title">{{ meta.next_title or next.title }}</p>
</div>
<i class="fa-solid fa-angle-right"></i>
</a>
{%- endif %}
</div>
1 change: 1 addition & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
'navbar_persistent': [],
'navbar_end': ['version-switcher', 'theme-switcher', 'navbar-icon-links'],
'secondary_sidebar_items': ['page-toc', 'book-demo'],
'show_prev_next': False, # turn off default theme
'article_footer_items': ['prev-next'],
'content_footer_items': [],
'footer_start':['copyright'],
Expand Down
4 changes: 4 additions & 0 deletions source/getting-started/fioup-registration/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:next_link: ../install-fioctl/index.html

Check warning on line 1 in source/getting-started/fioup-registration/index.rst

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Fio-docs.Branding-and-names] Use 'Fioctl' instead of 'fioctl' Raw Output: {"message": "[Fio-docs.Branding-and-names] Use 'Fioctl' instead of 'fioctl'", "location": {"path": "source/getting-started/fioup-registration/index.rst", "range": {"start": {"line": 1, "column": 24}}}, "severity": "INFO"}

:next_title: Installing Fioctl

Registering Your Device with Fioup
==================================

Expand Down
4 changes: 4 additions & 0 deletions source/getting-started/install-fioctl/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:prev_link: ../index.html

:prev_title: Getting Started

.. _gs-install-fioctl:

Installing Fioctl
Expand Down