Skip to content

Commit 0d31923

Browse files
authored
Merge pull request #138 from dynamist/f/sphinx-7.2-patches
Fix a compatibility issue introduced in Sphinx 7.2.0 and later that changes path handling to Pathlib
2 parents 50f7438 + 348718f commit 0d31923

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sphinx_material/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import re
77
import sys
88
from multiprocessing import Manager
9+
from pathlib import Path
910
from typing import List, Optional
1011
from xml.etree import ElementTree
1112

@@ -71,7 +72,9 @@ def create_sitemap(app, exception):
7172
):
7273
return
7374

74-
filename = app.outdir + "/sitemap.xml"
75+
outdir = app.outdir if isinstance(app.outdir, Path) else str(app.outdir)
76+
filename = str(Path(outdir) / "sitemap.xml")
77+
7578
print(
7679
"Generating sitemap for {0} pages in "
7780
"{1}".format(len(app.sitemap_links), console.colorize("blue", filename))

0 commit comments

Comments
 (0)