Fix header and footer.

This commit is contained in:
Relintai 2021-11-21 16:28:13 +01:00
parent 0b08069895
commit 446d0c13e7

View File

@ -31,6 +31,8 @@ void WPApplication::blog_fun(Object *instance, Request *request) {
} }
void WPApplication::index(Request *request) { void WPApplication::index(Request *request) {
request->head += header;
HTMLBuilder b; HTMLBuilder b;
b.div("content"); b.div("content");
@ -46,10 +48,13 @@ void WPApplication::index(Request *request) {
b.cdiv(); b.cdiv();
request->body += b.result; request->body += b.result;
request->body += footer;
request->compile_and_send_body(); request->compile_and_send_body();
} }
void WPApplication::blog(Request *request) { void WPApplication::blog(Request *request) {
request->head += header;
String blog = request->get_current_path_segment(); String blog = request->get_current_path_segment();
Database *db = nullptr; Database *db = nullptr;
@ -99,6 +104,7 @@ void WPApplication::blog(Request *request) {
b.cdiv(); b.cdiv();
request->body += b.result; request->body += b.result;
request->body += footer;
request->compile_and_send_body(); request->compile_and_send_body();
return; return;
} else { } else {
@ -137,6 +143,7 @@ void WPApplication::blog(Request *request) {
b.cdiv(); b.cdiv();
request->body += b.result; request->body += b.result;
request->body += footer;
request->compile_and_send_body(); request->compile_and_send_body();
} }
@ -261,7 +268,7 @@ void WPApplication::compile_menu() {
bh.w("WPSaver"); bh.w("WPSaver");
bh.ctitle(); bh.ctitle();
bh.link()->rel_stylesheet()->href("site.css"); bh.link()->rel_stylesheet()->href("/site.css");
bh.write_tag(); bh.write_tag();
header = bh.result; header = bh.result;