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

Fix error during linkcheck when trying to write pygments.css #2097

5 changes: 3 additions & 2 deletions src/pydata_sphinx_theme/pygments.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ def overwrite_pygments_css(app: Sphinx, exception=None):

# re-write pygments.css
pygments_css = Path(app.builder.outdir) / "_static" / "pygments.css"
with pygments_css.open("w") as f:
f.write(get_pygments_stylesheet(light_theme, dark_theme))
# Ensure the _static folder exists for all builders
pygments_css.parent.mkdir(exist_ok=True)
pygments_css.write_text(get_pygments_stylesheet(light_theme, dark_theme))
Loading