fix: use media_path from config instead of hardcoded value#342
Merged
rochacbruno merged 1 commit intomainfrom Aug 16, 2025
Merged
fix: use media_path from config instead of hardcoded value#342rochacbruno merged 1 commit intomainfrom
rochacbruno merged 1 commit intomainfrom
Conversation
- Pass media_path from site configuration to find_matching_file function - Update get_card_image and get_banner_image to accept media_path parameter - Fix recursive call to get_banner_image within get_card_image - Update all tests to pass media_path parameter - Fix clippy warning in image_provider test This allows users to configure a custom media folder name in their marmite.yaml configuration file instead of being forced to use 'media'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a bug where the media folder name was hardcoded to
"media"instead of using the configurablemedia_pathvalue from the site configuration.Problem
The
find_matching_filefunction incontent.rswas using a hardcoded"media"string instead of respecting the user's configuredmedia_pathsetting inmarmite.yaml.Solution
media_pathfrom site configuration through the function chainget_card_imageandget_banner_imagefunctions to accept themedia_pathparameterget_banner_imagewithinget_card_imageChanges
src/content.rs:media_pathparameter"media"with configurable valuesrc/tests/content.rs:src/tests/image_provider.rs:Test plan
cargo test- 220 tests passmask fmt- Code formattedmask check- No clippy warningsmask pedantic- No pedantic warningsBreaking changes
None - This is an internal fix that maintains backward compatibility.