diff --git a/src/app.cpp b/src/app.cpp index e79f80b..5db2eda 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -1067,6 +1067,8 @@ nlohmann::json App::baseTemplateData(const httplib::Request& req) const } data["stylesheets"] = theme_manager.stylesheets(theme); data["current_theme"] = theme; + data["nav_center"] = config.substitutions.nav_center; + data["after_post"] = config.substitutions.after_post; return data; } diff --git a/src/config.cpp b/src/config.cpp index 0da9a98..07c75b7 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -98,5 +98,19 @@ E Configuration::fromYaml(const std::filesystem::path& path) { tree["default-theme"] >> config.default_theme; } + if(tree["substitutions"].has_key()) + { + if(tree["substitutions"]["nav-center"].has_key()) + { + tree["substitutions"]["nav-center"] >> + config.substitutions.nav_center; + } + if(tree["substitutions"]["after-post"].has_key()) + { + tree["substitutions"]["after-post"] >> + config.substitutions.after_post; + } + } + return E{std::in_place, std::move(config)}; } diff --git a/src/config.hpp b/src/config.hpp index 0f90db3..44c3ea1 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -8,6 +8,12 @@ #include "error.hpp" +struct Substitutions +{ + std::string nav_center; + std::string after_post; +}; + struct Configuration { using StringMap = std::unordered_map; @@ -23,6 +29,7 @@ struct Configuration std::vector languages; std::string blog_title; std::string default_theme; + Substitutions substitutions; StringMap vars; StringMap custom_vars; diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..584e0b3 --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,6 @@ + diff --git a/templates/nav.html b/templates/nav.html index f4d0085..46605c4 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -18,7 +18,7 @@ {% endif %} - + {{ nav_center }}