Link to IRC in menu doesn't work


I am using Hugo and in my config.toml I define my menu bar items :

name = “PHOTOS”
pre = “
weight = -120
url = “

name = “RSS”
pre = “
weight = -70
identifier = “rss”
url = “

name = “IRC: Arnob at geeknode”
url = “irc://”

It works fine except for the IRC menu. When I generate my blog, the result link when clicking in the menu for the irc is :

instead of : irc://

So after generating my blog, if I look at the html files in the public folder, the menu item for IRC is this :

<ul class="sidebar-nav">
      <li><a href="">ACCUEIL</a> </li>
      <li><a href="/blog/about/"> A PROPOS </a></li><li><a href=""> PHOTOS </a></li><li><a href="/blog/tags/"> TAGS </a></li><li><a href=""> RSS </a></li><li><a href="#ZgotmplZ"> IRC: Arnob at geeknode </a></li>

As you can see, I have href="#ZgotmplZ instead of the expected irc:// …

To understand better my problem you may visit my blog and click on the IRC item in the menu bar (last item on the left).

Thank you for any help.

“ZgotmplZ” is a special value that indicates that unsafe content reached a CSS or URL context at runtime.

You are looking for It has your exact issue as the example.

Ok, thank you.

So what I understand is that I have to add :

<a href="{{ .URL }}"> → <a href="#ZgotmplZ">
<a {{ printf "href=%q" .URL | safeHTMLAttr }}> → <a href="irc://">


But where?

You put that where your menu is generated, in your templates. If you need more help, please follow the suggestions at Requesting Help and share your code, so folks may assist you.

1 Like

Ok, thank you.