Non-content entry to a menu rendering error

I am trying to add a menu item that refer to a PowerPoint file for downloading. The config.toml file looks as follows:

baseurl = "http://my_site.com"
CanonifyUrls = true
contentdir = "content"
layoutdir = "layouts"
publishdir = "public"
languageCode = "en-us"
[[menu.extramedia]]
    name = "Presentation: Three Steps to Enrollment"
    URL = "/media/enrollment-sessions.ppt"
    weight = -120
    identifier = "PowerPoint"

When I run "hugo server" command, Hugo for some reason breaks the menu URL, and insert "/index" in it, i.e. the resulting link becomes "http://localhost:1313/media/enrollment-sessions/index.ppt/".
However, if I put absolute URL in the config file, i.e. URL = "http://localhost:1313/media/enrollment-sessions.ppt", Hugo leaves it as-is.

Is that a normal behavior?

It’s a bug. Could you open an issue at GitHub with link back here?

The thing is, for menu items defined in site config we use the URL to map it to a Node (home page, section, taxonomy) if applicable (for IsMenuCurrent etc.). And in some cases it can be hard to get it right manually (uglyurls settings, accents removed etc.), so we reformat the menu URLs so the look exactly the same.

This may have been a bad design choice, as it has some side effects that it may be even harder to get out off.

In you case, setting uglyurls=true might solve this, but it probably not what you want in the general case.

@bep, thank you. I’ve opened the ticket #1239.

Yes, uglyurls=true solves this problem but breaks the identification of the front page via

{{ if eq .RelPermalink "/index.html" }} 

So, I will stay with the absolute URL in the non-content menu for now…

In 0.15 DEV you can say

{{ if .IsHome }}