I am using the Statiq.Web NuGet package to render handlebar templates into a static website.
While I like the idea of Statiq a lot, there is little to no documentation on how to actually use it.
My Statiq pipeline currently looks as follows.
await Bootstrapper
.Factory
.CreateDefault(args)
.BuildPipeline("Render home", builder => builder
.WithInputReadFiles("home.hbs", "Partials/*.hbs")
.WithProcessModules(
new RenderHandlebars()
.WithModel(new MyModel())
.WithPartial("head", Config.FromContext(c => c.Inputs.First(i => i.Source.Name == "head.hbs").ContentProvider.GetTextReader().ReadToEnd())))
.WithOutputWriteFiles(".html"))
.RunAsync();
This does work and all the Handlebars features (placeholders and partials) are rendered correctly.
However, it does not feel 100% clean to read the content of the partial with: .ContentProvider.GetTextReader().ReadToEnd()
Is there a way to do this more elegantly?
I am using the
Statiq.WebNuGet package to render handlebar templates into a static website.While I like the idea of Statiq a lot, there is little to no documentation on how to actually use it.
My Statiq pipeline currently looks as follows.
This does work and all the Handlebars features (placeholders and partials) are rendered correctly.
However, it does not feel 100% clean to read the content of the partial with:
.ContentProvider.GetTextReader().ReadToEnd()Is there a way to do this more elegantly?