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 · 1 comment

Comments

Projects
None yet
3 participants
@abirger

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Oct 12, 2015

Member

@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?

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 in d35d820 Dec 6, 2015

@anthonyfok anthonyfok added this to the v0.16 milestone Dec 7, 2015

bramp added a commit to bramp/hugo that referenced this issue Dec 17, 2015

tychoish added a commit to tychoish/hugo that referenced this issue Aug 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment