Fetch and save entry HTML content with metadata
And render the extracted HTML on the entry page in the frontend.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use axum::extract::{State, Path};
|
||||
use axum::response::Response;
|
||||
use maud::html;
|
||||
use maud::{html, PreEscaped};
|
||||
use sqlx::PgPool;
|
||||
|
||||
use crate::error::Result;
|
||||
@@ -12,7 +12,7 @@ pub async fn get(Path(id): Path<i32>, State(pool): State<PgPool>, layout: Layout
|
||||
Ok(layout.render(html! {
|
||||
@let title = entry.title.unwrap_or_else(|| "Untitled".to_string());
|
||||
h1 { a href=(entry.url) { (title) } }
|
||||
@let description = entry.description.unwrap_or_else(|| "No description".to_string());
|
||||
p { (description) }
|
||||
@let content = entry.html_content.unwrap_or_else(|| "No content".to_string());
|
||||
(PreEscaped(content))
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user