You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 1, 2023. It is now read-only.
Tyler Barnes edited this page Jan 5, 2019
·
1 revision
Menu data lives at /wordsby/data/menus.json in your gatsby site.
This file is updated via github or gitlab api every time you save a menu.
You can call menus by their slug using the Wordsby component <MenuItems />
importMenuItemsfrom"../wordsby/MenuItems";// this file is in wordsby-starter
For simplicity you can use <MenuItems slug="slug-name" /> to return a group of gatsby links.
For more control use children as a function to get the menu items:
<MenuItemsslug="main-menu">{items=>{returnitems.map(({ url, active, activeParent, title })=>(<Linkkey={url}to={url}className={active||activeParent ? "active" : ""}>{title}</Link>));}}</MenuItems>