Skip to content

Commit 736ccc9

Browse files
authored
Merge pull request #82 from out-of-cheese-error/feat/handlebars_misc_helpers
feat(template): added handlebars_misc_helpers
2 parents 04ad83e + 1464919 commit 736ccc9

File tree

4 files changed

+212
-0
lines changed

4 files changed

+212
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1313
### Fixed
1414
- markdown preview in search (Issue [#74](https://github.com/out-of-cheese-error/gooseberry/issues/74))
1515

16+
### Added
17+
- handlebars_misc_helpers (Issue [#81](https://github.com/out-of-cheese-error/gooseberry/issues/66))
18+
1619
## [0.8.0] - 2021-03-14
1720
### Fixed
1821
* All w3 selectors (partially) supported (Issue [#66](https://github.com/out-of-cheese-error/gooseberry/issues/66))

Cargo.lock

Lines changed: 207 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ handlebars = "3.5.4"
5959

6060
# Sanitizing filenames
6161
sanitize-filename = "0.3.0"
62+
handlebars_misc_helpers = "0.11.2"
6263

6364
[dev-dependencies]
6465
assert_cmd = "1.0.3"

src/gooseberry/knowledge_base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ impl<'a> Default for Templates<'a> {
107107

108108
pub(crate) fn get_handlebars(templates: Templates) -> color_eyre::Result<Handlebars> {
109109
let mut hbs = Handlebars::new();
110+
handlebars_misc_helpers::register(&mut hbs);
110111
hbs.register_escape_fn(handlebars::no_escape);
111112
hbs.register_helper("date_format", Box::new(date_format));
112113
hbs.register_template_string("annotation", templates.annotation_template)?;

0 commit comments

Comments
 (0)