Made site template mobile friendly and added title to RSS feed
[biaweb2.git] / biawebrss.hpp
index eb4d0aa..61cee82 100644 (file)
@@ -69,6 +69,7 @@ namespace biaweb {
     // class to implement an RSS feed
     class RSSFeed {
       protected:
+        std::string title; 
         std::time_t pub_date;
         std::list<RSSFeedItem> items;
       public:
@@ -80,6 +81,13 @@ namespace biaweb {
         // number of items
         std::size_t get_num_items () {
             return this->items.size ();
+        }
+
+        std::string get_title () {
+            return this->title;
+        }
+        void set_title (std::string title) {
+            this->title = escape_html (title);
         } 
 
         std::time_t get_pub_date() {
@@ -103,7 +111,8 @@ namespace biaweb {
 
                 std::string output = fmt::format (templ_str, 
                                             fmt::arg ("pubdate", ct),
-                                            fmt::arg ("items", items_str) );
+                                            fmt::arg ("items", items_str),
+                                            fmt::arg ("title", this->title));
                 std::ofstream f (path + "/feed.xml");
                 f << output;
                 f.close ();