aboutsummaryrefslogtreecommitdiff
path: root/src/content/markdown/Markdown.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/markdown/Markdown.cpp')
-rw-r--r--src/content/markdown/Markdown.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/content/markdown/Markdown.cpp b/src/content/markdown/Markdown.cpp
new file mode 100644
index 0000000..2009772
--- /dev/null
+++ b/src/content/markdown/Markdown.cpp
@@ -0,0 +1,51 @@
+#include "Markdown.hpp"
+
+Markdown::Markdown(std::string uriBasePath, std::string markdownFilesPath)
+ : Content(), m_UriBasePath(uriBasePath), m_MainTemplatePath(""), m_MarkdownFilesPath(markdownFilesPath)
+{
+}
+
+bool Markdown::Init()
+{
+ std::cout << "Markdown files path: " << m_MarkdownFilesPath << std::endl;
+
+ std::vector<std::string> extensions = {"md"};
+
+ if (m_MarkdownFiles.Scan(m_MarkdownFilesPath, extensions, false) == false)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+void Markdown::Shutdown()
+{
+ std::cout << "Markdown module shutdown" << std::endl;
+}
+
+bool Markdown::Render(RequestResponse & rr, RenderData & rd, std::string & out)
+{
+ (void)out;
+
+ rd["blub"] = "Yoh21!";
+ rr.UseOutputHeader();
+ rr.AddOutputHeader("blaaaa", "blubb");
+
+ return true;
+}
+
+std::string const & Markdown::GetUriBasePath() const
+{
+ return m_UriBasePath;
+}
+
+std::string const & Markdown::GetMainTemplate() const
+{
+ return m_MainTemplatePath;
+}
+
+Redirections const & Markdown::GetRedirections() const
+{
+ return m_Redirections;
+}