Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
abirger opened this issue Jun 30, 2015 · 2 comments · Fixed by #12461
Closed

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

abirger opened this issue Jun 30, 2015 · 2 comments · Fixed by #12461
Milestone

Comments

@abirger
Copy link

abirger commented Jun 30, 2015

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.

@bep
Copy link
Member

bep commented Oct 12, 2015

@spf13 - I think I'm gonna remove the transformation of the menu urls. It is a slightly breaking change, but it was a bad idea in the first place. People are smart enough to get the URLs correct. Agree?

gunnaraasen added a commit to gunnaraasen/hugo that referenced this issue Dec 2, 2015
@bep bep closed this as completed in d35d820 Dec 6, 2015
@anthonyfok anthonyfok added this to the v0.16 milestone Dec 7, 2015
bramp pushed a commit to bramp/hugo that referenced this issue Dec 17, 2015
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2022
bep added a commit to bep/hugo that referenced this issue May 5, 2024
bep added a commit that referenced this issue May 5, 2024
This is how we should have fixed #1239.

Fixes #12456
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants