Skip to content

feat: Extend MiniJinja with sha256, base64 utility filters (#23)#24

Merged
mikkeldamsgaard merged 1 commit intomainfrom
feature/jinja-utility-functions-23
Feb 25, 2026
Merged

feat: Extend MiniJinja with sha256, base64 utility filters (#23)#24
mikkeldamsgaard merged 1 commit intomainfrom
feature/jinja-utility-functions-23

Conversation

@mikkeldamsgaard
Copy link
Contributor

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

Copilot AI review requested due to automatic review settings February 25, 2026 13:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.rs module with SHA-256 hashing and Base64 encoding/decoding filters
  • Integration of custom filters into both render and seed template environments
  • Comprehensive documentation in docs/templating.md with 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.

@mikkeldamsgaard mikkeldamsgaard force-pushed the feature/jinja-utility-functions-23 branch from b36749b to 858aca3 Compare February 25, 2026 13:50
@mikkeldamsgaard mikkeldamsgaard force-pushed the feature/jinja-utility-functions-23 branch from 858aca3 to 2cb727d Compare February 25, 2026 13:57
@mikkeldamsgaard mikkeldamsgaard merged commit c9f7ef4 into main Feb 25, 2026
5 checks passed
@mikkeldamsgaard mikkeldamsgaard deleted the feature/jinja-utility-functions-23 branch February 26, 2026 19:00
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.

Extend MiniJinja with Additional Utility Functions (sha256, base64)

2 participants