41 lines
1.2 KiB
Rust
41 lines
1.2 KiB
Rust
pub(crate) mod files;
|
|
pub(crate) mod music;
|
|
pub(crate) mod projects;
|
|
|
|
use crate::html::elements::{Heading, Link};
|
|
use crate::html::layouts::Division;
|
|
use crate::html::pages::BasePage;
|
|
use crate::html::{Render, boxed_vec};
|
|
use actix_web::{Responder, get};
|
|
|
|
#[get("/")]
|
|
async fn index() -> impl Responder {
|
|
// introduction
|
|
let hi = Heading::builder().text("Hello and welcome!").build();
|
|
let detail = Heading::builder()
|
|
.level(2)
|
|
.text(
|
|
"This here is a small website to show the passion I have for computers.<br>\
|
|
I have always had a good time creating and discovering new things.<br>\
|
|
Your may discover some of my projects here on this little showcase.",
|
|
)
|
|
.build();
|
|
let intro = Division::builder()
|
|
.id("intro")
|
|
.classes(vec!["intro"])
|
|
.elements(boxed_vec![hi, detail])
|
|
.build();
|
|
// css
|
|
let index = Link::builder()
|
|
.rel("stylesheet")
|
|
.href("static/css/index.css")
|
|
.build();
|
|
// add elements to the page in order
|
|
let page = BasePage::builder()
|
|
.title("AINDUSTRIES")
|
|
.head(boxed_vec![index])
|
|
.body(boxed_vec![intro])
|
|
.build();
|
|
page.render()
|
|
}
|