diff --git a/module.nix b/module.nix index a958906..80d5798 100644 --- a/module.nix +++ b/module.nix @@ -132,6 +132,14 @@ in access_log off; ''; }; + "/event/assets/" = { + alias = "${cfg.content}/content/event/assets/"; + tryFiles = "$uri $uri/ =404"; + extraConfig = '' + expires max; + access_log off; + ''; + }; "/team/assets/" = { alias = "${cfg.content}/content/team/assets/"; tryFiles = "$uri $uri/ =404"; diff --git a/src/main.rs b/src/main.rs index 7f5de57..bdf8085 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,6 +83,7 @@ async fn main() -> anyhow::Result<()> { let router = route(&ContentPaths { blog: args.content_directory.join("blog/assets"), + event: args.content_directory.join("event/assets"), text_blocks: args.content_directory.join("text_blocks/assets"), document: args.content_directory.join("documents/download"), team: args.content_directory.join("team/assets"), diff --git a/src/routes/mod.rs b/src/routes/mod.rs index 06de068..bd23715 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -28,6 +28,7 @@ mod text_blocks; pub(crate) struct ContentPaths { pub(crate) blog: PathBuf, + pub(crate) event: PathBuf, pub(crate) text_blocks: PathBuf, pub(crate) document: PathBuf, pub(crate) team: PathBuf, @@ -47,6 +48,7 @@ pub(crate) fn route(content_paths: &ContentPaths) -> Router { ServeDir::new(&content_paths.text_blocks), ) .nest_service("/blog/assets", ServeDir::new(&content_paths.blog)) + .nest_service("/event/assets", ServeDir::new(&content_paths.event)) .route("/documents/:lang", get(list_documents)) .nest_service( "/documents/download",