Skip to content

Non-content entry to a menu with a relative URL produces a rendering error  #1239

@abirger

Description

@abirger

There is a bug in non-content menu implementation that results in a broken link to a file if a relative URL is used in a config file menu entry. For example, if the config.toml file looks as follows:

baseurl = "http://my_site.com"
CanonifyUrls = true
[[menu.extramedia]]
    name = "Presentation: Three Steps to Enrollment"
    url = "/media/enrollment-sessions.ppt"
    weight = -120
    identifier = "PowerPoint"

the rendered link to the .ppt file looks like

http://my_site.com/media/enrollment-sessions/index.ppt/

However, if the absolute URL is used instead of the relative one, the resulting URL is OK. i.e.

baseurl = "http://my_site.com"
CanonifyUrls = true
[[menu.extramedia]]
    name = "Presentation: Three Steps to Enrollment"
    url = "http://my_site.com/media/enrollment-sessions.ppt"
    weight = -120
    identifier = "PowerPoint"

renders to

http://my_site.com/media/enrollment-sessions.ppt/

Related thread in Hugo Discussion is here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions