Skip to content

Page menu URLs vs permalinkable output formats #5849

Closed

Description

@akshaybabloo

After setting section = ["HTML", "RSS", "AMP"] in config.tomal all the hyperlinks in the page links to http://domain.com/amp/.... This was working fine in 0.54.

Activity

  1. changed the title [-]Multiple output types defaults to /amp/ links[/-] [+]Multiple output types defaults to /amp/ links in 0.55[/+] on Apr 13, 2019
  2. bep commented on Apr 13, 2019

    @bep
    Member

    all the hyperlinks in the page links to

    What do you mean by ALL?

    Note that we added a Permalinkable config option on the Output Format -- this defaults to true for HTML and AMP. You can turn that off, but you need to add a output format config section.

  3. akshaybabloo commented on Apr 13, 2019

    @akshaybabloo
    ContributorAuthor

    Any links that have been generated by Hugo that links to other pages in the same domain, not to the external domain. Permalinkable is not the problem I guess.

    Does adding AMP to sections turn all non-AMP links to AMP? as in localhost:1313/blog/welcome to localhost:1313/amp/blog/welcome in a page with URL localhost:1313/blog? This was not the case in 0.54.

  4. bep commented on Apr 14, 2019

    @bep
    Member

    Does adding AMP to sections turn all non-AMP links to AMP? as in localhost:1313/blog/welcome to localhost:1313/amp/blog/welcome in a page with URL localhost:1313/blog? This was not the case in 0.54.

    No.

    I will double check the logic to make sure that we only link from AMP => AMP, but when you now do .RelPermalink on a page when rendering the AMP variant, it will link to the AMP variant.

    If this is not what you want, you can turn it off. See above.

  5. changed the title [-]Multiple output types defaults to /amp/ links in 0.55[/-] [+]Check AMP vs Permalinkable[/+] on Apr 14, 2019
  6. added this to the v0.55.2 milestone on Apr 14, 2019
  7. akshaybabloo commented on Apr 16, 2019

    @akshaybabloo
    ContributorAuthor

    No.

    But it's happening to me for some reason.

    I am not using . RelPermalink BTW I am using .Permalink. Are both same?

  8. bep commented on Apr 16, 2019

    @bep
    Member

    Are both same?

    They are conceptually the same, yes.

  9. added a commit that references this issue on Apr 17, 2019
  10. bep commented on Apr 17, 2019

    @bep
    Member

    @akshaybabloo I have added some more tests for this -- and it behaves exactly as expected.

  11. modified the milestones: v0.55.2, v0.56 on Apr 17, 2019
  12. akshaybabloo commented on Apr 18, 2019

    @akshaybabloo
    ContributorAuthor

    OK, I am not sure what the problem is then:

    The code is here -> https://github.com/akshaybabloo/gollahalli.com

    The output options I have in my config.toml is:

    [outputs]
      home = ["HTML", "RSS", "AMP", "searchindex"]
      page = ["HTML", "RSS", "AMP"]
      section = ["HTML", "RSS"]

    Now, I have removed section from it but I still get amp URL in my nav bar, the code for that is:

    https://github.com/akshaybabloo/gollahalli.com/blob/8d31bbc560fd7b0cd7e236e05b9d748194a68e08/themes/Spark/layouts/index.html#L20-L24

            <ul class="uk-subnav uk-subnav-divider uk-flex-center uk-visible@m gol-subnav">
                {{ range .Site.Menus.main }}
                    <li><a href="{{ .URL }}">{{ .Name }}</a></li>
                {{ end }}
            </ul>

    The about and projects has amp links I have no idea why.

  13. bep commented on Apr 18, 2019

    @bep
    Member

    OK, the page menus. I understand now. I will fix this, eventually, but you can get back the old behaviour by adding a AMP definition with permalinkable turned off:

    https://gohugo.io/templates/output-formats#readout

  14. changed the title [-]Check AMP vs Permalinkable[/-] [+]Page menu URLs vs permalinkable output formats[/+] on Apr 18, 2019
  15. modified the milestones: v0.56, v0.55.3 on Apr 18, 2019
  16. akshaybabloo commented on Apr 18, 2019

    @akshaybabloo
    ContributorAuthor

    you mean by adding permalinkable = false in the config.toml right?

  17. bep commented on Apr 18, 2019

    @bep
    Member

    Something llike this:

    [outputFormats]
    [outputFormats.AMP]
    permalinkable = false
    
  18. added a commit that references this issue on Apr 19, 2019
    be97f6e
  19. added a commit that references this issue on Apr 19, 2019
    ea529c8
  20. github-actions commented on Feb 18, 2022

    @github-actions

    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.

  21. locked as resolved and limited conversation to collaborators on Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions