jannikbuschke / gatsby-antd-docs

A gatsby starter for a technical documentation website
https://www.jannikbuschke.de/gatsby-antd-docs/
MIT License
68 stars 21 forks source link

Enable external links in menuItems.json #12

Open jamesefhawkins opened 4 years ago

jamesefhawkins commented 4 years ago

I was hoping to create an external link in the top menu:

[
  { 
    "name": "Docs",
    "link":  "/docs"
  },
  { 
    "name": "Login",
    "link":  "https://app.posthog.com/login"
  }
]

In this case, the second item, the external link, won't work. I'd image this should work something like:

[
  { 
    "name": "Docs",
    "link":  "/docs"
  },
  { 
    "name": "Login",
    "a":  "https://app.posthog.com/login"
  }
]

I may be missing something here?

jannikbuschke commented 4 years ago

hi @jamesefhawkins ,

Currently I think the "menuItems.json" does not really do anything. The header links are defined in /src/Header.tsx. There you can just instantiate Menu.Items and links (<a hreft"...) however you like.

Generally I think the menuItems.json could be used populate headers/links, however Im not 100% sure about the setup of this library. I want to further develop this thing and provide new features. However if you customize Header.tsx I do so to in this library, it might be not so easy for you to pick this stuff up. So it might be that menuItems.json is the place for "user content", and if I updated this library, you and others can just patch "Header.tsx" or whatever other component. Im not so sure about this, just thinking out loud.

Pls just edit Header.tsx for the time being.