Skip to content

Commit

Permalink
🐛 FIX: Fix Path use for Sphinx 8 (#16)
Browse files Browse the repository at this point in the history
* Fix Path use for Sphinx 8 

* Improve Path syntax

Co-authored-by: Adam Turner <[email protected]>

* Update changelog

---------

Co-authored-by: Adam Turner <[email protected]>
  • Loading branch information
jdillard and AA-Turner authored Aug 25, 2023
1 parent 04d3228 commit 2d45e9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Changelog

*Release date: TBD*

* Fix Path use for Sphinx 8
[#16](https://github.com/jdillard/sphinx-gitstamp/pull/16)
* Clean up how package versions are handled
* Install pre-commit with isort, black, and flake8
[#7](https://github.com/jdillard/sphinx-gitstamp/pull/7)
Expand Down
11 changes: 3 additions & 8 deletions sphinx_gitstamp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import datetime
import os
import sys
from pathlib import Path

from sphinx import errors

Expand All @@ -30,14 +31,8 @@ def page_context_handler(app, pagename, templatename, context, doctree):
if g is None:
# We have already errored about this
pass
fullpagename = pagename
docsrc = ""
try:
docsrc = app.confdir + "/"
if docsrc != "/":
fullpagename = docsrc + pagename
except KeyError:
pass

fullpagename = Path(app.confdir, pagename)

# Don't barf on "genindex", "search", etc
if not os.path.isfile("%s.rst" % fullpagename):
Expand Down

0 comments on commit 2d45e9b

Please sign in to comment.