Styling for articles
This commit is contained in:
1 parent
824e6a5d72
commit
1d67f611fc
4 files changed
+105
-18
No files matched your search
@@ -1,7 +1,10 @@
|
||||
use axum::extract::{Extension, Path};
|
||||
use maud::html;
|
||||
|
||||
use crate::posts_store::ConcurrentPostsStore;
|
||||
use crate::{
|
||||
posts_store::ConcurrentPostsStore,
|
||||
template,
|
||||
};
|
||||
use super::response::{Error, Html};
|
||||
|
||||
pub async fn handle(
|
||||
@@ -17,13 +20,19 @@ pub async fn handle(
|
||||
.with_crawler_permissive()
|
||||
.with_title_owned(post.title().to_owned())
|
||||
.with_head(html! {
|
||||
link href="/static/styles/main.css" rel="stylesheet";
|
||||
link href="/static/styles/code.css" rel="stylesheet";
|
||||
})
|
||||
.with_body(html! {
|
||||
h1 { (post.title()) }
|
||||
p { "by " (post.author()) }
|
||||
article {
|
||||
.with_body(template::main_page(html! {
|
||||
section .article_header {
|
||||
h1 .article_title { (post.title()) }
|
||||
@if let Some(subtitle) = post.subtitle() {
|
||||
p .article_subtitle { (subtitle) }
|
||||
}
|
||||
p .article_published_date { "Published " (post.created().format("%Y/%m/%d")) }
|
||||
}
|
||||
article .article_content {
|
||||
(post.html())
|
||||
}
|
||||
}))
|
||||
})))
|
||||
}
|
||||
Reference in new issue
Block a user