aboutsummaryrefslogtreecommitdiff
path: root/src/content/blog
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/blog')
-rw-r--r--src/content/blog/Blog.cpp41
-rw-r--r--src/content/blog/Blog.hpp25
2 files changed, 66 insertions, 0 deletions
diff --git a/src/content/blog/Blog.cpp b/src/content/blog/Blog.cpp
new file mode 100644
index 0000000..56a23c1
--- /dev/null
+++ b/src/content/blog/Blog.cpp
@@ -0,0 +1,41 @@
+#include "Blog.hpp"
+
+Blog::Blog(std::string uriBasePath, std::string mainTemplatePath)
+ : Content(), m_UriBasePath(uriBasePath), m_MainTemplatePath(mainTemplatePath)
+{
+ m_Redirections.push_back(uriBasePath + "/");
+ m_Redirections.push_back(uriBasePath + "/index.html");
+}
+
+bool Blog::Init()
+{
+ return true;
+}
+
+void Blog::Shutdown()
+{
+}
+
+bool Blog::Render(RequestResponse & rr, RenderData & rd)
+{
+ rd["blah"] = "Yoh!";
+ rr.UseOutputHeader();
+ rr.AddOutputHeader("bla", "blubb");
+
+ return true;
+}
+
+std::string const & Blog::GetUriBasePath() const
+{
+ return m_UriBasePath;
+}
+
+std::string const & Blog::GetMainTemplate() const
+{
+ return m_MainTemplatePath;
+}
+
+Redirections const & Blog::GetRedirections() const
+{
+ return m_Redirections;
+}
diff --git a/src/content/blog/Blog.hpp b/src/content/blog/Blog.hpp
new file mode 100644
index 0000000..086acc7
--- /dev/null
+++ b/src/content/blog/Blog.hpp
@@ -0,0 +1,25 @@
+#ifndef BLOG_H
+#define BLOG_H 1
+
+#include "../../Content.hpp"
+
+class Blog : public Content
+{
+public:
+ explicit Blog(std::string uriBasePath, std::string mainTemplatePath);
+
+ bool Init();
+ void Shutdown();
+ bool Render(RequestResponse & rr, RenderData & rd);
+
+ std::string const & GetUriBasePath() const;
+ std::string const & GetMainTemplate() const;
+ Redirections const & GetRedirections() const;
+
+private:
+ std::string m_UriBasePath;
+ std::string m_MainTemplatePath;
+ Redirections m_Redirections;
+};
+
+#endif