Skip to content

Do not append index with dirhtml #77

@hugovk

Description

@hugovk

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions