#include "biawebutil.hpp"
#include "biawebsidebar.hpp"
#include "biawebstrings.hpp"
+#include "biawebnavigationbit.hpp"
// class to represent a biaweb document which can have a file name, title, description,
// keywords, content and sidebar items
std::string meta_desc;
std::string meta_keywords;
std::string content;
- std::list<SideBar> sidebars;
+ std::list<SideBar> sidebars;
+ NavigationBit navbit;
std::time_t cdate;
std::time_t mdate;
bool is_index;
// fourth line onwards: Markdown contents
Document (std::istream &file) ;
+ // set the navigation bit
+ void set_navigation_bit (NavigationBit navbit) {
+ this->navbit = navbit;
+ }
+
// set whether this is the index document
void set_index (bool index = true) {
this->is_index = index;
this->mdate = this->cdate;
// read the rest of contents
std::string line;
- std::getline (infile, line);
while (! infile.eof ()) {
- contents.append (line + "\n");
std::getline (infile, line);
+ contents.append (line + "\n");
}
this->set_markdown_content (contents);
}
sidebartext += bar.to_html (templatedir);
}
+ // render the navigation bit
+ std::string navbit_str = this->navbit.to_html (templatedir);
+
// time of creation and modification
struct std::tm c, m;
c = *std::localtime (&this->cdate);
fmt::arg ("description", this->meta_desc),
fmt::arg ("cdate", c),
fmt::arg ("mdate", m),
+ fmt::arg ("navbit", navbit_str),
fmt::arg ("contents", this->content),
fmt::arg ("sidebar", sidebartext)
);