#include <ctime>
#include "biawebutil.hpp"
#include "biawebsidebar.hpp"
+#include "biawebstrings.hpp"
// class to represent a biaweb document which can have a file name, title, description,
// keywords, content and sidebar items
void Document::output_to_html (std::string templatedir, std::string path)
{
std::ifstream tpl;
- tpl.open (templatedir + "/main.tpl.html", std::ios_base::openmode::_S_in);
+ tpl.open (templatedir + "/main.tpl.html");
std::string main_tpl ( (std::istreambuf_iterator<char> (tpl)),
(std::istreambuf_iterator<char> ()) );
tpl.close ();
std::time_t creat = this->cdate;
std::time_t modif = this->cdate;
std::strftime (ctm_str, sizeof (ctm_str),
- "%d %b %Y, %H:%M", std::localtime (&creat));
+ DATE_FORMAT, std::localtime (&creat));
std::strftime (mtm_str, sizeof (mtm_str),
- "%d %b %Y, %H:%M", std::localtime (&modif));
+ DATE_FORMAT, std::localtime (&modif));
// Allocate enough space for the output buffer
std::unique_ptr<char[]> final_templ(
200 +
sidebartext.size()]);
std::sprintf (final_templ.get (), main_tpl.c_str(), this->title.c_str(),
+ this->meta_keywords.c_str(), this->meta_desc.c_str (),
ctm_str, mtm_str,
this->content.c_str(), sidebartext.c_str());