Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with handeling home tab in navbar #61

Closed
karasun0 opened this issue Sep 5, 2020 · 3 comments
Closed

Trouble with handeling home tab in navbar #61

karasun0 opened this issue Sep 5, 2020 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@karasun0
Copy link
Contributor

karasun0 commented Sep 5, 2020

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
@lxndrblz
Copy link
Owner

lxndrblz commented Sep 5, 2020

@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.

@karasun0
Copy link
Contributor Author

karasun0 commented Sep 5, 2020

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.

@lxndrblz
Copy link
Owner

lxndrblz commented Sep 6, 2020

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"]

@lxndrblz lxndrblz added the question Further information is requested label Sep 7, 2020
@lxndrblz lxndrblz self-assigned this Sep 7, 2020
@lxndrblz lxndrblz closed this as completed Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants