Distinguish attachments, which are non-markdown files that should be served/copied directly, not processed into a template.

This commit is contained in:
2025-05-04 00:30:43 -05:00
parent 91ea5fbfce
commit 9e44884dde
3 changed files with 57 additions and 14 deletions

View File

@@ -35,6 +35,8 @@ async fn page<'r>(
let path_str = path.to_str().unwrap();
if let Some(resource_path) = renderer.resolve_to_resource(path_str) {
Some(PageResponder::File(NamedFile::open(resource_path).await.unwrap()))
} else if let Some(attachment_path) = historian.resolve_to_attachment(path_str) {
Some(PageResponder::File(NamedFile::open(attachment_path).await.unwrap()))
} else {
historian.resolve_to_page(path_str).map(|page| {
if let Some(query) = origin.query() {