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

use pathlib path in sitemap plugin for sphinx compatibility #4215

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/sphinx_sitemap_ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from multiprocessing import Manager
from typing import Any, Dict, List, Optional
from xml.etree import ElementTree
from pathlib import Path

from sphinx.application import Sphinx
from sphinx.util.logging import getLogger
Expand Down Expand Up @@ -225,7 +226,7 @@ def create_sitemap(app: Sphinx, exception):
href=site_url + scheme.format(lang=lang, version=version, link=link),
)

filename = app.outdir + "/" + app.config.sitemap_filename
filename = Path.joinpath(app.outdir, app.config.sitemap_filename)
ElementTree.ElementTree(root).write(
filename, xml_declaration=True, encoding="utf-8", method="xml"
)
Expand Down
Loading