projects
/
biaweb2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made site template mobile friendly and added title to RSS feed
[biaweb2.git]
/
biawebrss.hpp
diff --git
a/biawebrss.hpp
b/biawebrss.hpp
index
eb4d0aa
..
61cee82
100644
(file)
--- a/
biawebrss.hpp
+++ b/
biawebrss.hpp
@@
-69,6
+69,7
@@
namespace biaweb {
// class to implement an RSS feed
class RSSFeed {
protected:
// class to implement an RSS feed
class RSSFeed {
protected:
+ std::string title;
std::time_t pub_date;
std::list<RSSFeedItem> items;
public:
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 ();
// 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() {
}
std::time_t get_pub_date() {
@@
-103,7
+111,8
@@
namespace biaweb {
std::string output = fmt::format (templ_str,
fmt::arg ("pubdate", ct),
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 ();
std::ofstream f (path + "/feed.xml");
f << output;
f.close ();