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

Canonical URL: don't set it if is empty #93

Merged
merged 1 commit into from Oct 6, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Oct 6, 2020

Fix #82

Ref #83

We need to release the extension first, make sure all builds are using
that version and then release readthedocs/readthedocs.org#7540

Fix #82

Ref #83

We need to release the extension first, make sure all builds are using
that version and then release readthedocs/readthedocs.org#7540
@stsewd stsewd requested a review from a team October 6, 2020 17:26
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice solution 👍 Just one question that I don't understand. It seems we're testing for that case, but I don't understand the logic.

{%- else %}
{%- set ending = "/" if builder == "readthedocsdirhtml" else ".html" %}
{%- set canonical_page = pagename + ending %}
{%- if canonical_url %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to check for and not html_baseurl? Seems that would output 2x canonical URL still.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are doing that check in readthedocs/readthedocs.org#7540.
We could do the check here again, but seems redundant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also do all the checks here, but by doing it in .org we can set the value in html_baseurl and rely on sphinx itself to set the canonical url instead of us doing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, makes sense.

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

Successfully merging this pull request may close these issues.

"canonical" URL should be escaped
2 participants