Crow
Crow copied to clipboard
How to use mustache Sections?
I would like to re-use html templates like the header. Is it possible to do with Crow?
Here they talk about those sections https://jgonggrijp.gitlab.io/wontache/mustache.5.html
I tried this but it renders the string, and doesn't go into html
auto header = crow::mustache::load_text("header.html");
ctx["header"] = header;
auto page = crow::mustache::load("index.html");
return crow::response(200, page.render(ctx));
My site is old, but maybe it will be helpful -> https://github.com/mrozigor/mrozigor.net/blob/master/src/controllers/MainController.cpp