Functionality for generating website completed
[biaweb2.git] / biawebdocument.hpp
index edfed7e..9829bcd 100644 (file)
@@ -8,6 +8,7 @@
 #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
@@ -137,7 +138,7 @@ namespace biaweb {
     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 ();
@@ -151,9 +152,9 @@ namespace biaweb {
         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(
@@ -165,6 +166,7 @@ namespace biaweb {
                                             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());