Anatole: Trouble with handeling home tab in navbar

Created on 5 Sep 2020  Â·  3Comments  Â·  Source: lxndrblz/anatole

Hi to everyone and thanks for this theme.
I was using your theme and I checked.
even without content/_index.md and content/posts/_index.md, The Home navbar works just fine.

But when I want to use it, with or without the two _index.md files mentioned , It doesn't work.

Hugo:

Hugo Static Site Generator v0.74.3-DA0437B4 linux/amd64 BuildDate: 2020-07-23T16:22:34Z

config.toml:


[menu]

  [[menu.main]]
  name = "خانه"
  identifier = "home"
  weight = 100
  url = "/"

  [[menu.main]]
  name = "دوره‌ها"
  weight = 200
  identifier = "courses"
  url = "/courses/"


  [[menu.main]]
  name = "درباره ما"
  weight = 300
  identifier = "about us"
  url = "/about-us/"

Those درباره ما and etc are in Persian language.

and in contents/courses/test.md

---
title: "This Problem"
---
blah ....
asdlfaskljd
asdfjaskdfjas
dfkjasdfkk
question

All 3 comments

@karasun0 Thanks for your in-depth explanation and for providing some code snippets. Let's try to get it resolved together.

What's the exact error you are having? Is it not showing your courses when linking to courses?

I am currently away from a PC, but it might be because courses is its own type and not of type psor. Either set the type to post or adjust the mainSections to include courses (see the documentation for an example). It should display them then too.

Hope that helps.

That helped!
/post/ works but /courses/ doesn't.

Why is this happening and can you fix it? (Doesn't needd to be soon or to be at all)

Thanks, Karasun0.

Anatole offers the flexibility to also allow custom types such as a course. Simply add a custom course folder to the content directory and place your test.md in there. In your menu you will have to link the corresponding folder:

  [[menu.main]]
  name = "Courses"
  weight = 200
  identifier = "courses"
  url = "/course/"

image

If you want to show the courses on the frontpage as well, you might want to include course in your mainSections:

mainSections = ["post", "course"]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

codyleyhan picture codyleyhan  Â·  4Comments

mattarnster picture mattarnster  Â·  5Comments

Corfucinas picture Corfucinas  Â·  5Comments

tangxuemei1995 picture tangxuemei1995  Â·  4Comments

PiotrWachulec picture PiotrWachulec  Â·  6Comments