diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-10-14 18:41:55 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-10-14 18:41:55 +0200 |
commit | 51d9d23c99d77edad03e6425f3ab35a390156117 (patch) | |
tree | 82b632c2aac22c3d79f43e427f311a46591f30ca /src/content/markdown/Markdown.hpp | |
parent | f0f4b8a4d139a855ad15f9d79190edf6320eba51 (diff) |
Blog Metadata parsing, validationa and templating.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/content/markdown/Markdown.hpp')
-rw-r--r-- | src/content/markdown/Markdown.hpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/content/markdown/Markdown.hpp b/src/content/markdown/Markdown.hpp index 41c8b4d..9c4d3c4 100644 --- a/src/content/markdown/Markdown.hpp +++ b/src/content/markdown/Markdown.hpp @@ -4,10 +4,12 @@ #include "../../Content.hpp" #include "../../Filesystem.hpp" +using Markdowns = std::unordered_map<std::string, std::shared_ptr<std::string> >; + class Markdown : public Content { public: - explicit Markdown(std::string uriBasePath, std::string markdownFilesPath); + explicit Markdown(std::string uriBasePath, std::string markdownFilesPath, std::string mainTemplatePath = ""); bool Init(); void Shutdown(); @@ -17,12 +19,17 @@ public: std::string const & GetMainTemplate() const; Redirections const & GetRedirections() const; + bool HasMarkdownFile(std::string filePath) const; + bool HasMarkdownURI(std::string uriPath) const; + Markdowns const & GetMarkdowns() const; + std::shared_ptr<std::string> const & GetMarkdownHTML(std::string uriPath); + private: std::string m_UriBasePath; std::string m_MainTemplatePath; std::string m_MarkdownFilesPath; Redirections m_Redirections; - Filesystem m_MarkdownFiles; + Markdowns m_Markdowns; }; #endif |