Minimal Mistakes - Sidebar Nav Won't Show

Hi,

I am struggling to add a custom sidebar nav to a page of my website but I can’t get it to show.

This is the content of the _data/navigation.yml file:

main:
  - title: "Cursuri"
    url: /cursuri/
  - title: "Despre mine"
    url: /despre/
  - title: "Blog"
    url: /blog/
  - title: "Contact"
    url: /contact/

cursuri_nav:
  - title: "Cursuri"
    children:
      - title: "MS Office"
        url: /
      - title: "Word - Avansat"
        url: /despre/
      - title: "Excel - Avansat"
        url: /contact/
        
  - title: "Alte informatii"
    children:
      - title: "Cum se desfasoara un curs"
        url: /blog/
      - title: "Ce pregatesc pentru curs"
        url: /blog/

I want to add cursuri_nav to the cursuri.md page. This is the content of cursuri.md:

---
layout: splash
author_profile: false
permalink: /cursuri/
sidebar:
  nav: cursuri_nav
---

As far as I was able to determine the formatting of both files is ok but I can’t get it to work. Could somebody, please, give me a hand?

website: Invata Office
github repo: GitHub - cb-websites/cursuri-office: Jekyll theme for building a personal site, blog, project documentation, or portfolio.

Thank you in advance!

Can you share a reference to the project or doc you are using as a reference for writing your code?

I searched Minimal Mistakes nav and got this which has sidebar in the YAML file.

I would started with a copied bit from there and then adjust it.

Your main section looks good from this.

Lastly, i have a feeling that using cursuri_nav in your frontmatter as a pointer to the navigation file is not supported in the theme or in YAML / Jekyll itself.

Can you explain how to arrived at this like from a doc or tutorial? I’m not familiar with the theme so i need to see the instructions you are following to see whether you followed correctly or not.

sidebar:
  nav: cursuri_nav

Hi. Thank for your answer. I got the reference from the theme documentation here but it does not seem to work and I don’t know why. The code and indentation seem to be ok but I taught I’m missing something.

Oh okay. That looks fine then what you have. Copy and paste the exact content from that guide and see if that works.

See if you can get the sidebar to show using a link I sent before.

You can also try clone and existing site that is set up the way you like and have at look at how it is setup to see what you are missing.

Try also run Jekyll with --verbose mode and look through the output for clues

Also as with any Jekyll theme, I would highly recommend you follow the option in the theme readme to install with remote theme

That means you add it to your config and Gemfile and install it. This avoids forking the entire repo of files you don’t need. So you can focus your repo on just your content pages.

See an example using remote theme here.

Note lack of HTML files.

So if the theme gets updates, I’ll get them immediately or just bump a version number used. No need to pull in changes from the original theme repo which might conflict with a fork.

I tried again making the sidebar work both with the YAML snippets on the link I initially used and the one you sent but to no avail. As far as the repo goes, I forked the theme owner’s Github repository and made the changes directly in Github. I did not clone it on my local machine. I also did dis with other Jekyll websites I own and never had any problems.

It’s kind of disappointing that, even though I am using the exact instructions in the documentation, it does not work.

Unrelated to this particular problem, there was another one that I managed to find a workaround for. For the page named “cursuri”, I actually wanted to name it “courses” but when trying to access it from the menu, or from the address bar, it kept showing me 404.
I eventually set its name and permalink to “cursuri” and it just worked.

Okay. Nevermind :slight_smile: I eventually found out what the problem was. I set the page layout to “single” and the menu is now visible.

1 Like