make html <title></title> configurable
This commit is contained in:
11
config.cpp
11
config.cpp
@@ -18,10 +18,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "permissions.h"
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include "config.h"
|
||||
#include "permissions.h"
|
||||
#include "varreplacer.h"
|
||||
std::string Config::required(const std::string &key)
|
||||
{
|
||||
auto it = this->configmap.find(key);
|
||||
@@ -99,6 +101,7 @@ Config::Config(const std::map<std::string, std::string> &map)
|
||||
this->handlersConfig.max_pagename_length = optional("max_pagename_length", 256);
|
||||
this->session_max_lifetime = optional("session_max_lifetime", 3600);
|
||||
this->handlersConfig.query_limit = optional("query_limit", 200);
|
||||
this->handlersConfig.page_title_template = optional("page_title_template", "{title} - {wikiname}");
|
||||
this->threadscount = optional("threadscount", 1);
|
||||
|
||||
this->handlersConfig.anon_permissions = Permissions(required("anon_permissions"));
|
||||
@@ -109,6 +112,10 @@ Config::Config(const std::map<std::string, std::string> &map)
|
||||
|
||||
ConfigVariableResolver resolver{this->configmap};
|
||||
this->configVarResolver = resolver;
|
||||
|
||||
Varreplacer replacer("{");
|
||||
replacer.addKeyValue("wikiname", this->handlersConfig.wikiname);
|
||||
this->handlersConfig.page_title_template = replacer.parse(this->handlersConfig.page_title_template);
|
||||
}
|
||||
|
||||
ConfigReader::ConfigReader(const std::string &file)
|
||||
|
Reference in New Issue
Block a user