34 std::vector<uint8_t> buf;
35 if (storage && storage->readFile(
filePath_, buf))
37 tpl.assign(buf.begin(), buf.end());
41 tpl =
"<h1>Template not found</h1>";
45 for (
const auto &[key, value] : context)
47 std::string placeholder =
"{{" + key +
"}}";
49 while ((pos = tpl.find(placeholder, pos)) != std::string::npos)
51 tpl.replace(pos, placeholder.length(), value);
52 pos += value.length();
static constexpr std::uintptr_t getTypeKey()