Merge branch 'main' of https://codeberg.org/supitszaire/indir
This commit is contained in:
commit
cc05d3b2d3
2 changed files with 12 additions and 2 deletions
12
README.md
12
README.md
|
|
@ -16,7 +16,17 @@ indir [--host address] [--port port] [--root http_root] directory
|
|||
--root http_root hosts on the specified subdirectory, i.e. `/files/`
|
||||
```
|
||||
|
||||
## customization
|
||||
|
||||
### readme
|
||||
drop a `README.md` into any directory and indir will render
|
||||
it below the file listing with full markdown support!
|
||||
|
||||
---
|
||||
|
||||
## to-do:
|
||||
- [x] use templates instead of hard-coded HTML (i was lazy)
|
||||
- [ ] directory header from readme file
|
||||
- [x] directory header from readme file
|
||||
- [ ] directory stylesheet overrides
|
||||
- [x] index.html serving support
|
||||
- [ ] fix mime-types for browser file view
|
||||
2
main.go
2
main.go
|
|
@ -175,7 +175,7 @@ func main() {
|
|||
}
|
||||
|
||||
// serve index.html if present (case-sensitive)
|
||||
indexPath := fpath + "/index.html"
|
||||
indexPath := filepath.Join(fpath, "index.html")
|
||||
if indexInfo, err := os.Stat(indexPath); err == nil && !indexInfo.IsDir() {
|
||||
http.ServeFile(w, r, indexPath)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue