This commit is contained in:
parent
fcd3d6ffca
commit
ac07105bf7
6 changed files with 87 additions and 29 deletions
10
src/main.rs
10
src/main.rs
|
@ -8,6 +8,7 @@
|
|||
use based::page::{Shell, render_page};
|
||||
use based::request::{RequestContext, StringResponse};
|
||||
use maud::html;
|
||||
use pkg::Repository;
|
||||
use rocket::get;
|
||||
use rocket::routes;
|
||||
|
||||
|
@ -16,13 +17,18 @@ pub mod routes;
|
|||
|
||||
#[get("/")]
|
||||
pub async fn index_page(ctx: RequestContext) -> StringResponse {
|
||||
let repos: Vec<String> = Repository::list();
|
||||
|
||||
let content = html!(
|
||||
h1 { "Hello World!" };
|
||||
h1 { "Repositories" };
|
||||
@for repo in repos {
|
||||
p { (repo) };
|
||||
};
|
||||
);
|
||||
|
||||
render_page(
|
||||
content,
|
||||
"Hello World",
|
||||
"Repositories",
|
||||
ctx,
|
||||
&Shell::new(html! {}, html! {}, Some(String::new())),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue