From 1d7d7ec250e440a2d98aee4bed0c18e54a50e207 Mon Sep 17 00:00:00 2001 From: Katrina Prosise Date: Fri, 6 Mar 2026 08:17:41 -0500 Subject: [PATCH] Add custom prev-next option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Checks page for `prev_link`/`next_link` and `prev_title`/`next_title` first, to allow for custom prev/next links. This also allow for custom titles, which, while not yet utilized, can be useful in situations such as shortening a long page title's link. Enabled on two pages, to address issue with container only path leading to an LmP content page, and for fioctl to point back to getting started, rather than an LmP content page. Checked running a local server instance for correct rendering and links. This commit applies to issue FFTK-4720, "…Getting Started flow…" This commit applies to issue FFTK-4681, "…Customizable prev/next…" Signed-off-by: Katrina Prosise --- README.md | 10 +++++ source/_templates/prev-next.html | 39 ++++++++++++------- source/conf.py | 1 + .../fioup-registration/index.rst | 4 ++ .../getting-started/install-fioctl/index.rst | 4 ++ 5 files changed, 45 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f4b69ba6..10a8e210 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,16 @@ vale :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: .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`. diff --git a/source/_templates/prev-next.html b/source/_templates/prev-next.html index a0ed0720..f3ea88ad 100644 --- a/source/_templates/prev-next.html +++ b/source/_templates/prev-next.html @@ -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. -#} - -{%- endif %} - -
+{# 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. #} + diff --git a/source/conf.py b/source/conf.py index 605df178..766282fe 100644 --- a/source/conf.py +++ b/source/conf.py @@ -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'], diff --git a/source/getting-started/fioup-registration/index.rst b/source/getting-started/fioup-registration/index.rst index 93a91ccc..f17d1cf6 100644 --- a/source/getting-started/fioup-registration/index.rst +++ b/source/getting-started/fioup-registration/index.rst @@ -1,3 +1,7 @@ +:next_link: ../install-fioctl/index.html + +:next_title: Installing Fioctl + Registering Your Device with Fioup ================================== diff --git a/source/getting-started/install-fioctl/index.rst b/source/getting-started/install-fioctl/index.rst index e8b49e4f..dc0ad95e 100644 --- a/source/getting-started/install-fioctl/index.rst +++ b/source/getting-started/install-fioctl/index.rst @@ -1,3 +1,7 @@ +:prev_link: ../index.html + +:prev_title: Getting Started + .. _gs-install-fioctl: Installing Fioctl