From 71308a8cabeb42120a8a2f1be69c83e1f118bbfe Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Feb 2024 16:06:51 +0100 Subject: [PATCH] Fix HTML "Last Modified" link in the footer (#3653) Add "peps/" to the URL. --- pep_sphinx_extensions/pep_processor/transforms/pep_footer.py | 2 +- .../tests/pep_processor/transform/test_pep_footer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pep_sphinx_extensions/pep_processor/transforms/pep_footer.py b/pep_sphinx_extensions/pep_processor/transforms/pep_footer.py index c49355fd1..ec83ca6a7 100644 --- a/pep_sphinx_extensions/pep_processor/transforms/pep_footer.py +++ b/pep_sphinx_extensions/pep_processor/transforms/pep_footer.py @@ -66,7 +66,7 @@ def _add_commit_history_info(pep_source_path: Path) -> nodes.paragraph: except KeyError: return nodes.paragraph() - commit_link = f"https://github.com/python/peps/commits/main/{pep_source_path.name}" + commit_link = f"https://github.com/python/peps/commits/main/peps/{pep_source_path.name}" link_node = nodes.reference("", f"{iso_time} GMT", refuri=commit_link) return nodes.paragraph("", "Last modified: ", link_node) diff --git a/pep_sphinx_extensions/tests/pep_processor/transform/test_pep_footer.py b/pep_sphinx_extensions/tests/pep_processor/transform/test_pep_footer.py index 9f040c5e1..e09c9c1c3 100644 --- a/pep_sphinx_extensions/tests/pep_processor/transform/test_pep_footer.py +++ b/pep_sphinx_extensions/tests/pep_processor/transform/test_pep_footer.py @@ -16,7 +16,7 @@ def test_add_commit_history_info(): assert str(out).startswith( "Last modified: " - '' + '' ) # A variable timestamp comes next, don't test that assert str(out).endswith("")