Cake addin for working with Handlebars templates
(This is very close in functionality to https://github.com/agc93/Cake.Handlebars. At some point, these should probably be merged.)
Add the Cake.HandlebarsDotNet
package to your Cake script:
#addin nuget:?package=Cake.HandlebarsDotNet&loaddependencies=true
Then use it in your script
Task("RenderTemplate")
.Does(() =>
{
var rendered = HandlebarsRenderText("Hello, {{Name}}!", new { Name = "World" });
Information($"Result: {rendered}");
});
Task("RenderTemplateFromFile")
.Does(() =>
{
var rendered = HandlebarsRenderTextFile("./template.handlebars", new { Name = "World" });
Information($"Result: {rendered}");
});
Task("RenderTemplateFromFileToFile")
.Does(() =>
{
HandlebarsRenderTextFile("./template.handlebars", "./rendered.txt", new { Name = "World" });
});
This project is built using Cake. Because this Cake addin targets net46 for compatibility with Cake 0.25.0, it does require being built in an environment where net46 is available. (Generally Windows) Development and testing is possible on macOS/Linux, but packaging for use with Cake will require building against net46.
On macOS/Linux:
./build.sh
On Windows:
.\build.ps1
We are committed to fostering an open and welcoming environment. Please read our code of conduct before participating in or contributing to this project.
We welcome contributions and collaboration on this project. Please read our contributor's guide to understand how best to work with us.
This software is made available by Daniel James under the MIT license.