Add header partial

This commit is contained in:
2023-06-01 00:59:39 -04:00
parent 1698ef9c60
commit e501c15c66
4 changed files with 18 additions and 1 deletions

View File

@@ -4,11 +4,12 @@ use sqlx::PgPool;
use crate::error::Result;
use crate::models::entry::get_entries;
use crate::partials::header::header;
pub async fn get(State(pool): State<PgPool>) -> Result<Markup> {
let entries = get_entries(&pool).await?;
Ok(html! {
h1 { "crawlnicle" }
(header())
ul {
@for entry in entries {
@let title = entry.title.unwrap_or_else(|| "Untitled".to_string());