Skip to content

Conversation

gildesmarais
Copy link
Member

This pull request introduces a mechanism to automatically merge global stylesheet configurations into individual feed configs when they do not already define their own stylesheets. This ensures that all feeds can benefit from a consistent global stylesheet unless overridden, and the logic is thoroughly tested to avoid unwanted side effects.

Feed configuration enhancements:

  • Added the merge_global_stylesheets method to LocalConfig, which merges global stylesheets into a feed config if the feed does not already specify its own stylesheets. The method duplicates the config to prevent mutation when merging.
  • Updated the find method in LocalConfig to use merge_global_stylesheets, ensuring feeds retrieved via .find automatically include global stylesheets when appropriate.
  • Incorporated global stylesheet merging into the main feed configuration flow in app.rb, so all feeds processed by the app have global stylesheets merged as needed.

Testing improvements:

  • Added comprehensive tests for merge_global_stylesheets in spec/html2rss/web/app/local_config_spec.rb, covering scenarios where configs already have stylesheets, where global stylesheets exist or not, and ensuring config objects are not mutated.
  • Added tests for .find to verify that stylesheet merging works as expected when retrieving feed configs.

@gildesmarais gildesmarais merged commit 9116d9d into master Sep 10, 2025
9 checks passed
@gildesmarais gildesmarais deleted the fix/stylesheet branch September 10, 2025 22:17
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.

1 participant