diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-10-22 17:25:04 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-10-22 17:25:04 +0200 |
commit | e9d684f5b5cfea813c168a59c0fe087d5456a444 (patch) | |
tree | 7c6fb0dcfaa42f86b3cf7a6c78f63c55fbdff770 /src/content/markdown/Markdown.cpp | |
parent | 9266070e51422a71566ee5c04db42feec996c485 (diff) |
Get request query value.
* Markdown module query processing and HTML output.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/content/markdown/Markdown.cpp')
-rw-r--r-- | src/content/markdown/Markdown.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/content/markdown/Markdown.cpp b/src/content/markdown/Markdown.cpp index 903fcec..2b0bcc6 100644 --- a/src/content/markdown/Markdown.cpp +++ b/src/content/markdown/Markdown.cpp @@ -88,13 +88,26 @@ bool Markdown::Render(RequestResponse & rr, RenderData & rd, std::string & out) rr.GetUriPath() == m_UriBasePath + "/index.html") { rr.UseUri(); - if (rr.QueryValueEquals("get", "bla") == true) + std::string requested_markdown; + + rd["uri"] = rr.GetUriPath(); + if (rr.GetQueryValue("get", requested_markdown) == true) { - rd["content"] = "bla"; + requested_markdown += ".md"; + if (HasMarkdownFile(requested_markdown) == true) + { + rd["content"] = *GetMarkdownHTML(requested_markdown); + } else if (HasMarkdownFile("index.md") == true) { + rd["content"] = *GetMarkdownHTML("index.md"); + } else { + return false; + } } - else + else if (HasMarkdownFile("index.md") == true) { - rd["content"] = "blubb"; + rd["content"] = *GetMarkdownHTML("index.md"); + } else { + return false; } } else |