diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-09-30 21:12:57 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-09-30 21:12:57 +0200 |
commit | 6c04dfe2caff1e03ba5c898b591327439452f616 (patch) | |
tree | 11c6f6955de188c48015641c1ae2e63b0d0e50d6 /src/content | |
parent | ec7cfa85530082127703278cf1ae5167990c0f45 (diff) |
CMS functionality works just find..minimal-working-example
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/blog/Blog.cpp | 36 | ||||
-rw-r--r-- | src/content/blog/Blog.hpp | 20 |
2 files changed, 31 insertions, 25 deletions
diff --git a/src/content/blog/Blog.cpp b/src/content/blog/Blog.cpp index f72ef70..56a23c1 100644 --- a/src/content/blog/Blog.cpp +++ b/src/content/blog/Blog.cpp @@ -1,37 +1,41 @@ #include "Blog.hpp" -Blog::Blog(std::string baseUri, std::string templatePath) : TemplatedContent(templatePath), m_BaseUri(baseUri), m_Redirections() +Blog::Blog(std::string uriBasePath, std::string mainTemplatePath) + : Content(), m_UriBasePath(uriBasePath), m_MainTemplatePath(mainTemplatePath) { - m_Redirections.push_back(baseUri + "-data"); + m_Redirections.push_back(uriBasePath + "/"); + m_Redirections.push_back(uriBasePath + "/index.html"); } -bool Blog::Init(void) +bool Blog::Init() { - return true; + return true; } -void Blog::Shutdown(void) +void Blog::Shutdown() { } -bool Blog::Render(RequestResponse & rr, std::string & out) +bool Blog::Render(RequestResponse & rr, RenderData & rd) { - (void)rr; + rd["blah"] = "Yoh!"; + rr.UseOutputHeader(); + rr.AddOutputHeader("bla", "blubb"); - rr.UseOutputHeader(); - rr.AddOutputHeader2("bla", "blubb"); - out = "blog-bla"; + return true; +} - return true; +std::string const & Blog::GetUriBasePath() const +{ + return m_UriBasePath; } -std::string const & Blog::GetBaseUri(void) const +std::string const & Blog::GetMainTemplate() const { - return m_BaseUri; + return m_MainTemplatePath; } -Redirections const & -Blog::GetRedirections(void) const +Redirections const & Blog::GetRedirections() const { - return m_Redirections; + return m_Redirections; } diff --git a/src/content/blog/Blog.hpp b/src/content/blog/Blog.hpp index 1de6e0f..086acc7 100644 --- a/src/content/blog/Blog.hpp +++ b/src/content/blog/Blog.hpp @@ -3,21 +3,23 @@ #include "../../Content.hpp" -class Blog : public TemplatedContent +class Blog : public Content { public: - explicit Blog(std::string baseUri, std::string templatePath); + explicit Blog(std::string uriBasePath, std::string mainTemplatePath); - bool Init(void); - void Shutdown(void); - bool Render(RequestResponse & rr, std::string & out); + bool Init(); + void Shutdown(); + bool Render(RequestResponse & rr, RenderData & rd); - std::string const & GetBaseUri() const; - Redirections const & GetRedirections() const; + std::string const & GetUriBasePath() const; + std::string const & GetMainTemplate() const; + Redirections const & GetRedirections() const; private: - std::string m_BaseUri; - Redirections m_Redirections; + std::string m_UriBasePath; + std::string m_MainTemplatePath; + Redirections m_Redirections; }; #endif |