feat: Extend MiniJinja with sha256, base64 utility filters (#23)#24
Merged
mikkeldamsgaard merged 1 commit intomainfrom Feb 25, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends MiniJinja templating capabilities by adding three custom utility filters (sha256, base64_encode, base64_decode) to support hashing and encoding operations in templates. The implementation creates a dedicated module for template functions, making it easy to extend with additional utilities in the future.
Changes:
- New
src/template_funcs.rsmodule with SHA-256 hashing and Base64 encoding/decoding filters - Integration of custom filters into both
renderandseedtemplate environments - Comprehensive documentation in
docs/templating.mdwith usage examples and error reference - Example template demonstrating filter usage and chaining capabilities
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/template_funcs.rs | New module implementing sha256, base64_encode, base64_decode filters with 16 unit tests covering normal operation, edge cases, error handling, and chaining |
| src/render.rs | Registers custom template filters in the render command's MiniJinja environment |
| src/seed/mod.rs | Registers custom template filters in the seed command's MiniJinja environment |
| src/main.rs | Declares the new template_funcs module |
| Cargo.toml | Adds sha2 0.10 and base64 0.22 dependencies |
| Cargo.lock | Lock file updates for new dependencies |
| docs/templating.md | New documentation file explaining all filters with usage patterns, chaining examples, and error reference |
| examples/template-functions/config.tmpl | Example template demonstrating sha256 and base64 filters in practical use cases |
| CHANGELOG.md | Documents the new features in the Unreleased section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b36749b to
858aca3
Compare
858aca3 to
2cb727d
Compare
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.
Closes #23 - Adds sha256, base64_encode, base64_decode MiniJinja template filters in dedicated src/template_funcs.rs module. Integrated into render and seed environments. Includes 16 unit tests, docs/templating.md, and example template. Verify: cargo fmt --check && cargo clippy -- -D warnings && cargo test --all