Skip to content

Commit

Permalink
refactor: use maud templates and serde_json for directory listings (#367
Browse files Browse the repository at this point in the history
)

* Use maud templates for directory listings
* Use serde_json to generate JSON formatted directory listings
* Restored previous behavior for file size display in HTML listings
* Reverted changes to JSON directory listings due to a performance regression
* Reinstated changes, not the cause of the performance regression
  • Loading branch information
palant committed Apr 27, 2024
1 parent b66c89e commit 5b5ea98
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 114 deletions.
46 changes: 46 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ compression-deflate = ["async-compression/deflate"]
compression-gzip = ["async-compression/deflate"]
compression-zstd = ["async-compression/zstd"]
# Directory listing
directory-listing = ["humansize", "chrono"]
directory-listing = ["humansize", "chrono", "maud"]
# Basic HTTP Authorization
basic-auth = ["bcrypt"]
# Fallback Page
Expand All @@ -75,13 +75,15 @@ humansize = { version = "2.1", features = ["impl_style"], optional = true }
hyper = { version = "0.14", features = ["stream", "http1", "http2", "tcp", "server"] }
lazy_static = "1.4.0"
listenfd = "1.0"
maud = { version = "0.26.0", optional = true }
mime_guess = "2.0"
percent-encoding = "2.3"
pin-project = "1.1"
regex = "1.10"
rustls-pemfile = { version = "2.1", optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_ignored = "0.1"
serde_json = "1.0"
serde_repr = "0.1"
tokio = { version = "1", default-features = false, features = ["rt-multi-thread", "macros", "fs", "io-util", "signal"] }
tokio-rustls = { version = "0.25", optional = true }
Expand Down
Loading

0 comments on commit 5b5ea98

Please sign in to comment.