Crow icon indicating copy to clipboard operation
Crow copied to clipboard

How to use mustache Sections?

Open rsousacode opened this issue 1 year ago • 1 comments

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));

rsousacode avatar Jan 02 '24 13:01 rsousacode

My site is old, but maybe it will be helpful -> https://github.com/mrozigor/mrozigor.net/blob/master/src/controllers/MainController.cpp

mrozigor avatar Jan 26 '24 18:01 mrozigor