diff options
Diffstat (limited to 'web/src/handlers.cpp')
| -rw-r--r-- | web/src/handlers.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web/src/handlers.cpp b/web/src/handlers.cpp index 1dfeb81..03cddd9 100644 --- a/web/src/handlers.cpp +++ b/web/src/handlers.cpp @@ -2,14 +2,17 @@ #include <fstream> #include <memory> +#include <optional> #include <string> +#include "config.hpp" #include "crow/http_response.h" #include "crow/mustache.h" #include "maddy/parser.h" namespace botweb { - crow::response get_wiki_page(const std::string &path) { + crow::response get_wiki_page(const std::string &path, + const std::optional<Configuration> &cfg) { std::shared_ptr<maddy::Parser> parser = std::make_shared<maddy::Parser>(); std::ifstream contents("docs/" + path + ".md"); @@ -25,6 +28,8 @@ namespace botweb { crow::mustache::context ctx; ctx["content"] = contents_html; ctx["summary"] = summary_html; + ctx["contact_url"] = (*cfg).contact_url; + ctx["contact_name"] = (*cfg).contact_name; return crow::response(200, page.render(ctx)); } |
