Open jmitchell opened 7 years ago
By the way, this was prompted because the generated class="nav tree"
part needs to be class="nav navbar-nav"
to look right with Bootstrap. Bootstrap also seems to expect class="active"
instead of class="current"
. I'm guessing their CSS API changed at some point.
At the very least I'd like Bootstrap support improved, but a more generic solution like the one proposed above would be even better.
EDIT: See PR #47 for Bootstrap navigation compatibility improvements.
This feature could resolve #27.
I'd consider a template if this isn't already solved by #47.
Eventually I'd like the flexibility to migrate away from Bootstrap or further customize the navigation, but as I continue playing with yst I may come up with better strategies. There's something to be said for $nav$
's current simplicity.
Thanks for taking the time to consider the issues and PRs I've filed.
$nav$
currently generates hard-coded HTML (see https://github.com/jgm/yst/blob/e3838d318318012d9237c9a34e792d1a630805d5/Yst/Render.hs#L77). It would be great if users could specify a template for it instead.If you're interested I can work on this and file a PR.
Possible solution
Custom nav templates could be specified by setting an optional setting in the config.
config.yaml
If it isn't set
$nav$
in a layout template could fallback to a default template which renders the same HTML yst does now. The default would be something like this:navmenu.st