From d8a60db7396afa09eba860a87af054ce88098ad2 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sun, 23 Jan 2022 23:01:16 +0400 Subject: [PATCH] Preparing for a single error page template --- src/server/response.cpp | 6 +++++- static/templates/404.html | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server/response.cpp b/src/server/response.cpp index 60f8caff..608d616a 100644 --- a/src/server/response.cpp +++ b/src/server/response.cpp @@ -106,7 +106,11 @@ HTTP404HtmlResponse::HTTP404HtmlResponse(const InternalServer& server, RESOURCE::templates::_404_html) { kainjow::mustache::list emptyList; - this->m_data = kainjow::mustache::object{{"details", emptyList}}; + this->m_data = kainjow::mustache::object{ + {"PAGE_TITLE", "Content not found"}, + {"PAGE_HEADING", "Not Found"}, + {"details", emptyList} + }; } HTTP404HtmlResponse& HTTP404HtmlResponse::operator+(UrlNotFoundMsg /*unused*/) diff --git a/static/templates/404.html b/static/templates/404.html index 795e8c9e..5fcc0ff2 100644 --- a/static/templates/404.html +++ b/static/templates/404.html @@ -2,10 +2,10 @@ - Content not found + {{PAGE_TITLE}} -

Not Found

+

{{PAGE_HEADING}}

{{#details}}

{{{p}}}