-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
i18n: Create Handlebars helper for dynamic navigation #281
i18n: Create Handlebars helper for dynamic navigation #281
Comments
I like this idea. It would make adding additional items to the navigation much simpler. I've had a look at the structure of the Maybe adding an
Or perhaps we could restructure the data for the secondary navigation into an array - something like this for example:
Either of these could provide what the data the Handlebars helper might need. |
The order of the menu items equals the order in the json. Please don't add more complexity than necessary. ;) |
I've always considered the ordering of objects to be somewhat volatile. I might be lacking in my understanding of the way node handles JSON objects. My understanding is more theoretical based and I haven't gone into much testing. Does node reliable maintain the order of properties within JSON objects?
|
The sidebar's menu's have started to grow in complexity and have deviated from a simple list managed by the This can be seen by the recent addition of dynamic links to the version specific API and customised markup - see #324. I'm not sure if or how to continue with #409. Any feedback on this would be appreciated. |
Closed by #409 |
At the moment, the main and sidebar navigation are all hardwired to the templates. So if a translation team decides to have a different structure or to leave out pages (e.g. the blog section), there will be broken links.
We need to create a Handlebars helper to build (partial) navigation based on the page structure in
site.json
instead. This way templating would be easier to handle, e.g.{{navigation}}
– renders the main navigation{{navigation 'about'}}
– renders the sub navigation matching the given keyThe text was updated successfully, but these errors were encountered: