title | date | description | category | background | image |
---|---|---|---|---|---|
Adding menu items |
2019-10-15 15:41:34 |
Add menu items in GraphQL to create a dynamic menu |
Gatsby |
#7d4cdb |
/assets/img/07.jpg |
The menu items translations are located in config/menu
and the useMenu
custom hook pulls these translations (via GraphQL query) and inserts them into the pages.
{
"menuItems": [
{ "name": "Home", "link": "/" },
{ "name": "About", "link": "/about-me" },
{ "name": "Blog", "link": "/blog" },
{ "name": "Contact", "link": "/contact" }
]
}