Skip to content

Commit 0abeaf2

Browse files
committed
Manually link page next-prev across child borders
The previous and next navigation links at the bottom of the page get filled automatically by vuepress, sourced from the (locale-specific) sidebar configuration. We define the sidebar through sections - which may be single page sections or a section with child pages. Previously, the website did not guide the user through our book. * Section prev always linked to previous section, never previous sections last child if available * Section next never linked to first child of section, if available * First child did not offer a prev link * Last child did not offer a next link I did not see documentation about customizing the auto-discover behavior, nor the sidebar structure dependency of the automatic determination. But page frontmatter can override the prev and next links. As a fixup, overriding the automatic discovery from the sidebar, we manually set the prev and next links on section child borders. The link text matches the headline/sidebar, and the links the sidebar structure. Given that this is manual configuration, there's a risk of it eventually being missed and becoming outdated or wrong when structure changes are made. I did not test. I don't have a local nodejs env. Resolves #1818 * https://v1.vuepress.vuejs.org/theme/default-theme-config.html#prev-next-links * https://v1.vuepress.vuejs.org/guide/i18n.html#default-theme-i18n-config * https://ecosystem.vuejs.press/themes/default/frontmatter.html#prev
1 parent 6dbce64 commit 0abeaf2

19 files changed

+116
-0
lines changed

book/advanced.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
prev:
3+
text: How Nushell Code Gets Run
4+
link: /book/how_nushell_code_gets_run.md
5+
next:
6+
text: Standard Library (Preview)
7+
link: /book/standard_library.md
8+
---
19
# (Not so) Advanced
210

311
While the "Advanced" title might sound daunting and you might be tempted to skip this chapter, in fact, some of the most interesting and powerful features can be found here.

book/background_jobs.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
next:
3+
text: Coming to Nu
4+
link: /book/coming_to_nu.md
5+
---
16
# Background Jobs
27

38
Nushell currently has experimental support for thread-based background jobs.

book/cheat_sheet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
next:
3+
text: Nu Fundamentals
4+
link: /book/nu_fundamentals.md
5+
---
16
# Nushell Cheat Sheet
27

38
## Data Types

book/coming_from_bash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
prev:
3+
text: Coming to Nu
4+
link: /book/coming_to_nu.md
5+
---
16
# Coming from Bash
27

38
::: tip

book/coming_to_nu.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
prev:
3+
text: Background Jobs
4+
link: /book/background_jobs.md
5+
next:
6+
text: Coming from Bash
7+
link: /book/coming_from_bash.md
8+
---
19
# Coming to Nu
210

311
If you are familiar with other shells or programming languages, you might find this chapter useful to get up to speed.

book/configuration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
prev:
3+
text: Nu as a Shell
4+
link: /book/nu_as_a_shell.md
5+
---
16
# Configuration
27

38
## Quickstart

book/custom_commands.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
prev:
3+
text: Programming in Nu
4+
link: /book/programming_in_nu.md
5+
---
16
# Custom Commands
27

38
As with any programming language, you'll quickly want to save longer pipelines and expressions so that you can call them again easily when needed.

book/design_notes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
prev:
3+
text: Nushell operator map
4+
link: /book/nushell_operator_map.md
5+
next:
6+
text: How Nushell Code Gets Run
7+
link: /book/how_nushell_code_gets_run.md
8+
---
19
# Design Notes
210

311
This chapter intends to give more in-depth overview of certain aspects of Nushell's design. The topics are not necessary for a basic usage, but reading them will help you understand how Nushell works and why.

book/getting_started.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
next:
3+
text: Quick Tour
4+
link: /book/quick_tour.md
5+
---
16
# Getting Started
27

38
Let's get started! :elephant:

book/how_nushell_code_gets_run.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
prev:
3+
text: Design Notes
4+
link: /book/design_notes.md
5+
next:
6+
text: (Not so) Advanced
7+
link: /book/advanced.md
8+
---
19
# How Nushell Code Gets Run
210

311
In [Thinking in Nu](./thinking_in_nu.md#think-of-nushell-as-a-compiled-language), we encouraged you to _"Think of Nushell as a compiled language"_ due to the way in which Nushell code is processed. We also covered several code examples that won't work in Nushell due that process.

0 commit comments

Comments
 (0)