4

I am using hugo (https://gohugo.io/) and trying to make an external link in the menu (docsy theme).

I changed the _index.md to:

---
title: "Documentation"
linkTitle: "Documentation"
url: "https://www.myurl.com"
weight: 20
menu:
  main:
    weight: 20
---

However hugo reports:

Rebuild failed: URLs with protocol (http*) not supported

Could anyone advise of how to create an external URL link directly on the menu?

Thanks, Gregor

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
grexor
  • 109
  • 1
  • 5

2 Answers2

3

Keep in mind that "url" is a predefined front matter variable that is meant to be used for defining the full path to the content page from the site root. If you want to add an external link in your front matter, I'd recommend giving the variable a different name, e.g. "external_url".

nciemniak
  • 31
  • 2
0

I just added something like this:

[[menu.main]]
    name = "GitHub"
    weight = 50
    url = "https://github.com/google/docsy/"

To the config.toml file.

I found this solution for the docsy theme here: https://www.docsy.dev/docs/adding-content/navigation/

Hope this helps, Gregor

grexor
  • 109
  • 1
  • 5