hugo URLs with protocol (http) not supported

808 Views Asked by At

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

2

There are 2 best solutions below

0
grexor On

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

0
nciemniak On

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".