vibed: how to use pure HTML instead of template engine?

Chris via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 6 07:45:25 PDT 2015


On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote:
> On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote:
>> Especially this: http://vibed.org/templates/diet#embedded-code
>
> I think that's a misfeature... if I used vibe.d, I'd want to 
> avoid the diet too.

I have never used the templates. Usually I generate the HTML 
myself, if its dynamic stuff, and send it back to the user as via 
res.writeBody:

auto html = someStringActions();
res.writeBody(cast(ubyte[])html);

For static pages I route to serverStaticFiles.


More information about the Digitalmars-d-learn mailing list