390 lines
8.6 KiB
Rust
390 lines
8.6 KiB
Rust
|
|
use crate::html;
|
||
|
|
use askama::Template;
|
||
|
|
use axum::response::IntoResponse;
|
||
|
|
use axum::{routing::get, Router};
|
||
|
|
|
||
|
|
pub fn get_router() -> Router {
|
||
|
|
Router::new()
|
||
|
|
.route("/", get(html::root::blog))
|
||
|
|
.route("/fsdi", get(fsdi))
|
||
|
|
.route("/independence", get(independence))
|
||
|
|
.route("/pri", get(pri))
|
||
|
|
.route("/gs", get(gs))
|
||
|
|
.route("/srw", get(srw))
|
||
|
|
.route("/tw", get(tw))
|
||
|
|
.route("/lt", get(lt))
|
||
|
|
.route("/writing", get(writing))
|
||
|
|
.route("/lim", get(lim))
|
||
|
|
.route("/ile", get(ile))
|
||
|
|
.route("/dmwi", get(dmwi))
|
||
|
|
.route("/wgl", get(wgl))
|
||
|
|
.route("/dm", get(dm))
|
||
|
|
.route("/llf", get(llf))
|
||
|
|
.route("/habits", get(habits))
|
||
|
|
.route("/deepwork", get(deepwork))
|
||
|
|
.route("/ewt", get(ewt))
|
||
|
|
.route("/afh", get(afh))
|
||
|
|
.route("/mfn", get(mfn))
|
||
|
|
.route("/sdl", get(sdl))
|
||
|
|
.route("/foundation", get(foundation))
|
||
|
|
.route("/mop", get(mop))
|
||
|
|
.route("/onreading", get(onreading))
|
||
|
|
.route("/thestart", get(thestart))
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn fsdi() -> impl IntoResponse {
|
||
|
|
let template = FirstStepsToDigitalIndependenceTemplate {
|
||
|
|
previous: "independence",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/FirstStepsToDigitalIndependence.html")]
|
||
|
|
struct FirstStepsToDigitalIndependenceTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn independence() -> impl IntoResponse {
|
||
|
|
let template = IndependenceTemplate {
|
||
|
|
previous: "pri",
|
||
|
|
next: "fsdi",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/Independence.html")]
|
||
|
|
struct IndependenceTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn pri() -> impl IntoResponse {
|
||
|
|
let template = PetsWorryAndInformationTemplate {
|
||
|
|
previous: "gs",
|
||
|
|
next: "independence",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/PetsWorryAndInformation.html")]
|
||
|
|
struct PetsWorryAndInformationTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn gs() -> impl IntoResponse {
|
||
|
|
let template = GraduateSchoolTemplate {
|
||
|
|
previous: "srw",
|
||
|
|
next: "pri",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/GraduateSchool.html")]
|
||
|
|
struct GraduateSchoolTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn srw() -> impl IntoResponse {
|
||
|
|
let template = SpeedReadingWorkbookTemplate {
|
||
|
|
previous: "tw",
|
||
|
|
next: "gs",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/SpeedReadingWorkbook.html")]
|
||
|
|
struct SpeedReadingWorkbookTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn tw() -> impl IntoResponse {
|
||
|
|
let template = ThisWebsiteTemplate {
|
||
|
|
previous: "lt",
|
||
|
|
next: "srw",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/ThisWebsite.html")]
|
||
|
|
struct ThisWebsiteTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn lt() -> impl IntoResponse {
|
||
|
|
let template = LevelingToolTemplate {
|
||
|
|
previous: "writing",
|
||
|
|
next: "tw",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/LevelingTool.html")]
|
||
|
|
struct LevelingToolTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn writing() -> impl IntoResponse {
|
||
|
|
let template = WritingTemplate {
|
||
|
|
previous: "lim",
|
||
|
|
next: "lt",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/Writing.html")]
|
||
|
|
struct WritingTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn lim() -> impl IntoResponse {
|
||
|
|
let template = LessIsMoreTemplate {
|
||
|
|
previous: "ile",
|
||
|
|
next: "writing",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/LessIsMore.html")]
|
||
|
|
struct LessIsMoreTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn ile() -> impl IntoResponse {
|
||
|
|
let template = ImmersiveLearningAndExperimentationTemplate {
|
||
|
|
previous: "dmwi",
|
||
|
|
next: "lim",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/ImmersiveLearningAndExperimentation.html")]
|
||
|
|
struct ImmersiveLearningAndExperimentationTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn dmwi() -> impl IntoResponse {
|
||
|
|
let template = DoingMoreWithMyIdeasTemplate {
|
||
|
|
previous: "wgl",
|
||
|
|
next: "ile",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/DoingMoreWithMyIdeas.html")]
|
||
|
|
struct DoingMoreWithMyIdeasTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn wgl() -> impl IntoResponse {
|
||
|
|
let template = WhyAndGettingLostTemplate {
|
||
|
|
previous: "dm",
|
||
|
|
next: "dmwi",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/WhyAndGettingLost.html")]
|
||
|
|
struct WhyAndGettingLostTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn dm() -> impl IntoResponse {
|
||
|
|
let template = DisciplineAndMotivationTemplate {
|
||
|
|
previous: "llf",
|
||
|
|
next: "wgl",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/DisciplineAndMotivation.html")]
|
||
|
|
struct DisciplineAndMotivationTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn llf() -> impl IntoResponse {
|
||
|
|
let template = LookingLikeAFoolTemplate {
|
||
|
|
previous: "habits",
|
||
|
|
next: "dm",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/LookingLikeAFool.html")]
|
||
|
|
struct LookingLikeAFoolTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn habits() -> impl IntoResponse {
|
||
|
|
let template = HabitsTemplate {
|
||
|
|
previous: "deepwork",
|
||
|
|
next: "llf",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/Habits.html")]
|
||
|
|
struct HabitsTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn deepwork() -> impl IntoResponse {
|
||
|
|
let template = DeepWorkTemplate {
|
||
|
|
previous: "ewt",
|
||
|
|
next: "habits",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/DeepWork.html")]
|
||
|
|
struct DeepWorkTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn ewt() -> impl IntoResponse {
|
||
|
|
let template = ExercisingWithoutTimeTemplate {
|
||
|
|
previous: "afh",
|
||
|
|
next: "deepwork",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/ExercisingWithoutTime.html")]
|
||
|
|
struct ExercisingWithoutTimeTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn afh() -> impl IntoResponse {
|
||
|
|
let template = AskingForHelpTemplate {
|
||
|
|
previous: "mfn",
|
||
|
|
next: "ewt",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/AskingForHelp.html")]
|
||
|
|
struct AskingForHelpTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn mfn() -> impl IntoResponse {
|
||
|
|
let template = AMindForNumbersTemplate {
|
||
|
|
previous: "sdl",
|
||
|
|
next: "afh",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/AMindForNumbers.html")]
|
||
|
|
struct AMindForNumbersTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn sdl() -> impl IntoResponse {
|
||
|
|
let template = SelfDirectedLearningTemplate {
|
||
|
|
previous: "foundation",
|
||
|
|
next: "mfn",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/SelfDirectedLearning.html")]
|
||
|
|
struct SelfDirectedLearningTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn foundation() -> impl IntoResponse {
|
||
|
|
let template = TheFoundationTemplate {
|
||
|
|
previous: "mop",
|
||
|
|
next: "sdl",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/TheFoundation.html")]
|
||
|
|
struct TheFoundationTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn mop() -> impl IntoResponse {
|
||
|
|
let template = TheMythOfPerfectionTemplate {
|
||
|
|
previous: "onreading",
|
||
|
|
next: "foundation",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/TheMythOfPerfection.html")]
|
||
|
|
struct TheMythOfPerfectionTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn onreading() -> impl IntoResponse {
|
||
|
|
let template = OnReadingTemplate {
|
||
|
|
previous: "thestart",
|
||
|
|
next: "mop",
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/OnReading.html")]
|
||
|
|
struct OnReadingTemplate<'a> {
|
||
|
|
previous: &'a str,
|
||
|
|
next: &'a str,
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn thestart() -> impl IntoResponse {
|
||
|
|
let template = TheStartTemplate {
|
||
|
|
next: "onreading"
|
||
|
|
};
|
||
|
|
html::HtmlTemplate(template)
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Template)]
|
||
|
|
#[template(path = "blog/TheStart.html")]
|
||
|
|
struct TheStartTemplate<'a> {
|
||
|
|
next: &'a str,
|
||
|
|
}
|