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

Wrong links for regular pages for non-HTML output formats #5877

Closed
regisphilibert opened this issue Apr 18, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@regisphilibert
Copy link

commented Apr 18, 2019

If I call an Output Format using (.OutputFormats.Get "that-output).Permalink/.RelPermalink or simply .Permalink/.RelPermalink on a "permalinkable" output formats, the returned url points to the main output format.

Considering the following bit of code added to baseof.html:

    this: {{ .Permalink }}
    {{ with .OutputFormats.Get "that-output" }}
      that-output: {{  .Permalink }}
    {{ end }}

From a list page (home, section) it would print

    this: https://www.example.com/
    that-output: https://www.example.com/that-output.html

From a regular page:

    this: https://www.example.com/
    that-output: https://www.example.com/

bep added a commit that referenced this issue Apr 19, 2019

@bep

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

I have added some more test in this area, and cannot reprodce what you see. Could you provide an example site with this behaviour?

@regisphilibert

This comment has been minimized.

Copy link
Author

commented Apr 19, 2019

Of course, here you go: https://github.com/regisphilibert/hugo-permalinks

home single
Capture d'écran 2019-04-19 08 47 22 Capture d'écran 2019-04-19 08 47 32

@bep bep added Bug and removed NeedsInvestigation labels Apr 20, 2019

@bep bep self-assigned this Apr 20, 2019

@bep bep added this to the v0.55.3 milestone Apr 20, 2019

bep added a commit to bep/hugo that referenced this issue Apr 20, 2019

Fix links for non-HTML output formats with baseName set
They were not correct for regular pages.

Fixes gohugoio#5877

@bep bep changed the title Output Formats permalink systematically points to main from RegularPage templates Wrong link for regular pages for non-HTML output formats with baseName set Apr 20, 2019

@bep bep changed the title Wrong link for regular pages for non-HTML output formats with baseName set Wrong links for regular pages for non-HTML output formats with baseName set Apr 20, 2019

bep added a commit to bep/hugo that referenced this issue Apr 20, 2019

Fix links for non-HTML output formats with baseName set
They were not correct for regular pages.

Fixes gohugoio#5877

@bep bep changed the title Wrong links for regular pages for non-HTML output formats with baseName set Wrong links for regular pages for non-HTML output formats Apr 20, 2019

bep added a commit to bep/hugo that referenced this issue Apr 20, 2019

Fix links for non-HTML output formats
They were not correct for regular pages.

Fixes gohugoio#5877

@bep bep closed this in #5881 Apr 20, 2019

bep added a commit that referenced this issue Apr 20, 2019

Fix links for non-HTML output formats
They were not correct for regular pages.

Fixes #5877
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.