35 lines
1.0 KiB
Rust
35 lines
1.0 KiB
Rust
use maud::{html, DOCTYPE};
|
|
use libsig::SongIdea;
|
|
|
|
pub fn main_page_template(idea: Option<SongIdea>) -> String {
|
|
let content = match idea {
|
|
Some(idea) => { idea.to_string() },
|
|
None => { "Generate a new idea with the links below!".to_string() }
|
|
};
|
|
let html = html! {
|
|
(DOCTYPE)
|
|
head {
|
|
link rel="stylesheet" href="style.css";
|
|
}
|
|
body {
|
|
h1 { "Song Idea Generator" }
|
|
p{ "Why don't you make a song like this: " }
|
|
p.content {
|
|
(content)
|
|
}
|
|
footer {
|
|
p {
|
|
a href="./generate" { "generate new" }
|
|
" | "
|
|
a href="./generate_ambient" { "generate new (ambient)" }
|
|
}
|
|
p {
|
|
a href="http://nora.codes" { "my blog" }
|
|
" | "
|
|
a href="https://git.nora.codes/nora/song-idea-generator" { "code" }
|
|
}
|
|
}
|
|
}
|
|
};
|
|
html.into()
|
|
} |