0
votes

I have two sections of my site, intro and core, that I want to have two different navigation bars.

Here is my navigation.yml

main:
  - title: "Intro"
    url: /intro/intro

  - title: "Core"
    url: /core/core-1

intro:
  - title: Introduction
    children: 
      - title: Intro
        url: /intro/welcome

core: 
  - title: Core
    children:
      - title: Core
        url: /core/core-1

Here is the relevant part of _config.yml

defaults:
  - scope:
      path: "intro"
      type: pages
    values:
      layout: single
      classes: wide
      sidebar:
        nav: "intro" 
  - scope:
      path: "core"
      type: pages
    values:
      layout: single
      classes: wide
      sidebar:
        nav: "core"

My directory structure is:

/_pages/intro/welcome.md
/_pages/core/core-1.md

This results in neither navigation is displayed. What's going on here?

1
I think you need to develop an _include file which iterates through your navigation array. If you still have issues, please show us the layout file(s).Keith Mifsud

1 Answers

0
votes

Michael Rose answered this question on his github issues page here.

It's not working because my paths were wrong. To make this work, I had to add _pages/ before the folder names.

defaults:
  - scope:
      path: _pages/intro
      type: pages
    values:
      layout: single
      classes: wide
      sidebar:
        nav: "intro" 
  - scope:
      path: _pages/core
      type: pages
    values:
      layout: single
      classes: wide
      sidebar:
        nav: "core"