diff --git a/axum_server/src/filters.rs b/axum_server/src/filters.rs new file mode 100644 index 0000000..73a16b6 --- /dev/null +++ b/axum_server/src/filters.rs @@ -0,0 +1,7 @@ +use chrono::{DateTime, Utc}; + +// This filter does not have extra arguments +pub fn pretty_date(date_time: &DateTime) -> ::askama::Result { + let formatted = format!("{}", date_time.format("%e %B %Y")); + Ok(formatted) +} diff --git a/axum_server/src/main.rs b/axum_server/src/main.rs index 23650c3..e90c44d 100644 --- a/axum_server/src/main.rs +++ b/axum_server/src/main.rs @@ -5,6 +5,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; mod components; mod feed; +mod filters; mod pages; mod post_list; mod post_parser; diff --git a/axum_server/src/pages/post_list.rs b/axum_server/src/pages/post_list.rs index 5d797bc..d180fa3 100644 --- a/axum_server/src/pages/post_list.rs +++ b/axum_server/src/pages/post_list.rs @@ -6,6 +6,7 @@ use crate::{ site_footer::{render_site_footer, SiteFooter}, site_header::{HeaderProps, Link}, }, + filters, post_list::get_post_list, post_parser::ParseResult, }; diff --git a/axum_server/styles/output.css b/axum_server/styles/output.css index 0209517..897e522 100644 --- a/axum_server/styles/output.css +++ b/axum_server/styles/output.css @@ -688,10 +688,19 @@ video { line-height: 1.25rem; } +.text-3xl { + font-size: 1.875rem; + line-height: 2.25rem; +} + .font-medium { font-weight: 500; } +.font-semibold { + font-weight: 600; +} + .italic { font-style: italic; } @@ -716,6 +725,16 @@ video { color: rgb(31 41 55 / var(--tw-text-opacity)); } +.text-blue-950 { + --tw-text-opacity: 1; + color: rgb(23 37 84 / var(--tw-text-opacity)); +} + +.text-blue-900 { + --tw-text-opacity: 1; + color: rgb(30 58 138 / var(--tw-text-opacity)); +} + .drop-shadow-md { --tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06)); filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); diff --git a/axum_server/templates/post_preview_card.html b/axum_server/templates/post_preview_card.html index f081886..cd2d481 100644 --- a/axum_server/templates/post_preview_card.html +++ b/axum_server/templates/post_preview_card.html @@ -1,11 +1,11 @@