From eb327c336a7af23eb642499875a8df7fec8fceae Mon Sep 17 00:00:00 2001 From: evanwill Date: Mon, 18 Sep 2023 17:11:51 -0700 Subject: [PATCH] add support for short nav title --- _layouts/sidebar.html | 8 ++++---- content/docs/pages.md | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/_layouts/sidebar.html b/_layouts/sidebar.html index 8c668bb..1f81d2d 100644 --- a/_layouts/sidebar.html +++ b/_layouts/sidebar.html @@ -19,7 +19,7 @@ {% if page.section or page.section_id %} {% endif %} - + @@ -76,7 +76,7 @@
@@ -123,7 +123,7 @@ {% assign next_page_title = nav_pages[next_number].title %}{% assign next_page_url = nav_pages[next_number].url %} {% endunless %} {%- endif -%} - {{ p.title }} + {{ p.nav | default: p.title }} {% endif %} {% endfor %} diff --git a/content/docs/pages.md b/content/docs/pages.md index f075dc1..324f76a 100644 --- a/content/docs/pages.md +++ b/content/docs/pages.md @@ -18,11 +18,12 @@ This information is used to configure the page and navigation added to the site' Use these values: -- `title:` value will appear as the H1 header at the top of the page, and in navigation links. -- `topics:` will appear as a small feature below the title (optional). +- `title:` (required) value will appear as the H1 header at the top of the page and in navigation links. +- `nav:` use nav only if you would like a value different than the title to appear in the sidebar navigation (optional, this can be helpful if you want to use a shorter title in the nav). +- `topics:` will appear as a small feature below the title (optional). These can serve as keywords to help your readers understand the focus of the section. - `description:` will appear as an indented text block below the title (optional). This gives you a chance to summarize the section contents. - `youtubeid:` will add an YouTube video embed (optional). Find the id in the YouTube link. For example, in `https://youtu.be/moJgWrD6dwg` or `https://www.youtube.com/watch?v=moJgWrD6dwg` the youtubeid is `moJgWrD6dwg`. -- Alternatively, if you don't want `title` or other options to appear on the page, you can over ride the section layout by adding `layout: default` +- Alternatively, if you don't want these features to appear on the page, you can over ride the layout by adding `layout:` with the option `sidebar`, `page`, or `default`. The sidebar navigation is set up using further front matter values following these rules: