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

Problem with canonifyurl #468

Open
mirisbowring opened this issue Nov 12, 2020 · 0 comments
Open

Problem with canonifyurl #468

mirisbowring opened this issue Nov 12, 2020 · 0 comments

Comments

@mirisbowring
Copy link
Contributor

What features are affected?

  • LandingPage Button (Home)
  • showVisitedLinks

What is the current bug behaviour?

If the website is not hosted on a subdomain but a namespace like:

https://www.domain.com/my-namespace/<here is the root>

baseURL = "https://www.domain.com/my-namespace/

following will happen:

  • if canonifyURL is enabled:
    • LandingPageButton (Home) is working as expected
    • showVisitedLinks is not working (here we have a strange behaviour):
menu.html
template "section-tree-nav"
...
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item {{if eq .File.UniqueID $currentFileUniqueID}}active{{end}}">
        <a href="{{ .RelPermalink}}">
...

though, both are using the .RelPermalink variable, the href also contains the baseURL and the data-nav-id does not!

  • if canonifyURL ist NOT enabled
    • landingPageButton (Home) redirects to https://www.domain.com/
    • showVisitedLinks is working as expected

What should the feature behave like?

That`s the question. It looks like we are having 2 bugs.
On the one side, the landing page button should work with and without the canonification.
On the other side, the showVisitedLinks feature should work both ways too.

Proposal

To fix the showVisitedLinks bug, replace .RePermalink with baseURL + path
To Fix the LandingPageButton bug, either mention this behaviour on the documentation and let the user specify the landingpage url (this param does already exist in config.toml) or build the url like showVisitedLinks.

Note

I will make a PR if i have some time left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant