Skip to content

Fix #2835: Trigger rebuild when theme files change#14421

Open
kishorhange111 wants to merge 3 commits intosphinx-doc:masterfrom
kishorhange111:fix-theme-rebuild-2835
Open

Fix #2835: Trigger rebuild when theme files change#14421
kishorhange111 wants to merge 3 commits intosphinx-doc:masterfrom
kishorhange111:fix-theme-rebuild-2835

Conversation

@kishorhange111
Copy link
Copy Markdown

This PR addresses an issue where changes to theme files (templates and static assets) were not detected by Sphinx, requiring a manual make clean before rebuilding.

The change introduces a theme_hash in BuildInfo to track theme file changes. When the hash differs from the previous build, Sphinx detects the mismatch and triggers a rebuild automatically.

  • Theme template changes now trigger a full rebuild.
  • Static asset changes are detected without requiring manual cleanup.
  • Existing behavior is preserved when no changes are detected.

Tests have been added to verify that theme changes correctly trigger rebuilds.

I have also tested this locally by modifying theme files and rebuilding without running make clean. Sphinx correctly detected the changes and triggered a rebuild, confirming the expected behavior.

Please let me know if any further adjustments would be helpful.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme developers should be able to configure sphinx to trigger rebuilds based on theme changes

1 participant