- Notifications
You must be signed in to change notification settings - Fork2
DotLiquid template engine http handlers for Giraffe web applications.
License
giraffe-fsharp/Giraffe.DotLiquid
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
DotLiquid templating engine http handlers for the Giraffe web framework.
TheGiraffe.DotLiquid
NuGet package adds additionalHttpHandler
functions to render DotLiquid templates in Giraffe.
dotLiquid
uses theDotLiquid template engine to set or modify the body of theHttpResponse
. This http handler triggers a response to the client and other http handlers will not be able to modify the HTTP headers afterwards any more.
ThedotLiquid
handler requires the content type and the actual template to be passed in as two string values together with an object model. This handler is supposed to be used as the base handler for other http handlers which want to utilize the DotLiquid template engine (e.g. you could create an SVG handler on top of it).
openGiraffeopenGiraffe.DotLiquidtypePerson={ FirstName:string LastName:string}letfooBar={ FirstName="Foo"; LastName="Bar"}lettemplate="<html><head><title>DotLiquid</title></head><body><p>First name: {{ firstName }}<br />Last name: {{ lastName }}</p></body></html>"letapp= choose[ route"/foo">=> dotLiquid"text/html" template fooBar]
dotLiquidTemplate
uses theDotLiquid template engine to set or modify the body of theHttpResponse
. This http handler triggers a response to the client and other http handlers will not be able to modify the HTTP headers afterwards any more.
This http handler takes a relative path of a template file, an associated model and the contentType of the response as parameters.
openGiraffeopenGiraffe.DotLiquidtypePerson={ FirstName:string LastName:string}letfooBar={ FirstName="Foo"; LastName="Bar"}letapp= choose[ route"/foo">=> dotLiquidTemplate"text/html""templates/person.html" fooBar]
dotLiquidHtmlTemplate
is the same asdotLiquidTemplate
except that it automatically sets the response astext/html
.
openGiraffeopenGiraffe.DotLiquidtypePerson={ FirstName:string LastName:string}letfooBar={ FirstName="Foo"; LastName="Bar"}letapp= choose[ route"/foo">=> dotLiquidHtmlTemplate"templates/person.html" fooBar]
Please find a fully functioning sample application under./samples/GiraffeDotLiquidSample/.
All official release packages are published to the official and public NuGet feed.
Nightly builds (builds from thedevelop
branch) produce unofficial pre-release packages which can be pulled from theproject's NuGet feed on GitHub.
These packages are being tagged with the Workflow's run number as the package version.
All other builds, such as builds triggered by pull requests produce a NuGet package which can be downloaded as an artifact from the individual GitHub action.
For more information about Giraffe, how to set up a development environment, contribution guidelines and more please visit themain documentation page.
About
DotLiquid template engine http handlers for Giraffe web applications.
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.