- std::ifstream tpl_linkitem ("templates/sidebarlinkitem.tpl.html");
- std::string tpl_linkitem_str ( (std::istreambuf_iterator<char> (tpl_linkitem)),
- (std::istreambuf_iterator<char> ()));
- tpl_linkitem.close ();
- std::unique_ptr<char[]> linktxt (new char[tpl_linkitem_str.size()
- + this->sidebar_text.size ()
- + this->sidebar_url.size ()] );
- std::sprintf (linktxt.get(), tpl_linkitem_str.c_str (),
- this->sidebar_url.c_str (),
- this->sidebar_text.c_str ());
- html.append (linktxt.get ());
+ std::string tpl_linkitem_str = t->get_genericlinklistitem_tpl ();
+ html = fmt::format (tpl_linkitem_str,
+ fmt::arg ("itemurl", this->itemurl),
+ fmt::arg ("itemtext", this->itemtext));