Skip to content

Commit

Permalink
adding link to find content
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Jun 16, 2024
1 parent f05c8cf commit 066b30e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 2 additions & 0 deletions src/routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -47,6 +48,7 @@ pub(crate) fn route(content_paths: &ContentPaths) -> Router<FoundationState> {
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",
Expand Down

0 comments on commit 066b30e

Please sign in to comment.