Wyamio / Wyam

A modular static content and static site generator.
MIT License
141 stars 29 forks source link

Folder API has no effect #14

Open aateeque opened 4 years ago

aateeque commented 4 years ago

I have a folder structure as follows:

|-
|--/src
|--|--/API
|--|--/blog
|--|--/products
|--|--/docs

No matter what a put inside that API folder (index.html, docs.md, etc) it doesn't appear in the nav bar in the Docs theme:

image

But if I change the name of that folder from API to anything else it works. It seems like a bug, a user shouldn't have to cater for specially named folders out of the box. But I guess I am doing something wrong, however haven't been able to figure out what.

daveaglick commented 4 years ago

The API folder is special because that's where the results of code analysis go by default so the theme doesn't check for other pages there. While maybe not a bug exactly, I totally agree the reliance on specific folder names isn't great (more on that below).

You can override the default navigation behavior by creating a _Navbar.cshtml file in your "input" folder. For reference, here's the default one: https://github.com/Wyamio/Wyam/blob/develop/themes/Docs/Samson/_Navbar.cshtml. Whatever you put in that file will override the default - so you can copy and paste the current one and then customize it to your needs.

Back to this being a bug/undesired behavior - it likely won't get fixed in Wyam. That's because Statiq is essentially a successor to Wyam (think of it as Wyam v3 + a rebrand). I'm not really doing much more in this codebase. Statiq uses a different folder-agnostic technique for finding files for the themes, so this hopefully won't be a problem there. That said, the docs portion of Statiq isn't ready to go yet so the solution above will hopefully work for you until it is.