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

Add a way to have {{doc.url.path}} without a trailing slash #1109

Open
uxder opened this issue Jun 23, 2020 · 0 comments
Open

Add a way to have {{doc.url.path}} without a trailing slash #1109

uxder opened this issue Jun 23, 2020 · 0 comments

Comments

@uxder
Copy link
Member

uxder commented Jun 23, 2020

if path and not path.endswith('/'):
always adds a trailing slash to the url.

In certain cases, it is undesirable to have the trailing slash. Could we create a way to get the route without a trailing slash?

Two key cases I'm trying to solve:

{{doc.url}}

    <link rel="canonical" href="{{doc.url}}">

always results in a trailing slash but we need to be able to specify one without it.

    <link rel="canonical" href="/about/">

Sitemap

Sitemap generation always results in a trailing slash.

<url>
<loc>https://xxx.com/about/</loc>
</url>

Desired:

<url>
<loc>https://xxx.com/about</loc>
</url>
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