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

Do not append index with dirhtml #77

Closed
hugovk opened this issue Oct 30, 2022 · 2 comments · Fixed by #78
Closed

Do not append index with dirhtml #77

hugovk opened this issue Oct 30, 2022 · 2 comments · Fixed by #78

Comments

@hugovk
Copy link
Contributor

hugovk commented Oct 30, 2022

Steps to reproduce

  1. Build docs using dirhtml that has ogp_site_url = "https://devguide.python.org/" in conf.py
git clone https://github.com/python/devguide
cd devguide
make dirhtml
# or:
# sphinx-build -b dirhtml -d _build/doctrees  -W --keep-going -n . _build/dirhtml
  1. Open a non-index page, for example _build/dirhtml/getting-started/getting-help/index.html and check og:url:
<meta property="og:url" content="https://devguide.python.org/getting-started/getting-help/" />

  1. Open a index page, _build/dirhtml/index.html and check og:url

Actual result

❌ Appends index to give a 404 URL: https://devguide.python.org/index/

<meta property="og:url" content="https://devguide.python.org/index/" />

Expected result

Don't append index for the main page:

<meta property="og:url" content="https://devguide.python.org/index/" />

See also

This came up at python/devguide#953 (comment), see the demo build at https://cpython-devguide--953.org.readthedocs.build/

@hugovk
Copy link
Contributor Author

hugovk commented Oct 30, 2022

Also need to deal with other index pages, such as _build/dirhtml/getting-started/index.html:

<meta property="og:url" content="https://devguide.python.org/getting-started/index/" />

https://devguide.python.org/getting-started/index/

https://devguide.python.org/getting-started/

@hugovk
Copy link
Contributor Author

hugovk commented Oct 30, 2022

PR #78 updated.

@hugovk hugovk changed the title Do not append index to main page with dirhtml Do not append index with dirhtml Oct 30, 2022
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 a pull request may close this issue.

1 participant