summary refs log tree commit diff
path: root/src/routes/mod.rs
blob: 935bab0637f80ee0958e71dbe47b90bd04f4690b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::PathBuf;

use morgana::{morx, render_tree_blocking};
use rocket::response::content::RawHtml;
use crate::components::{Layout};

#[get("/<page_path..>")]
pub fn render_page(page_path: PathBuf) -> RawHtml<String> {
    RawHtml(render_tree_blocking(morx! {
        Layout page_title="Test page" site_title="Stormscribe"
    }))
}

#[get("/<page_path..>?edit")]
pub fn render_editor(page_path: PathBuf) -> String {
    "not implemented".to_string()
}