- 2.1: packs/ -> archive/packs/ - 2.2: site/ -> archive/site/ - 2.3: src/lab/ -> archive/lab/ - 2.4: examples/ -> archive/examples-legacy/ (SSI-based)
51 lines
1.7 KiB
Text
51 lines
1.7 KiB
Text
# ASW Caddy Directory Listing — Caddyfile snippet
|
|
#
|
|
# Caddy's `file_server browse` outputs its own HTML, but accepts a custom
|
|
# template file via `browse { template_file }`. The template is a Go HTML
|
|
# template with access to directory metadata and file entries.
|
|
#
|
|
# See: browse.html in this directory for the ASW-styled template.
|
|
|
|
# ── Option A: Custom template (recommended, Caddy v2.6+) ─────────────────────
|
|
#
|
|
# Full control over the listing HTML. Browse template receives:
|
|
# .Name — directory name (last path segment)
|
|
# .Path — current URL path (e.g. "/files/")
|
|
# .Files — []FileInfo, each with:
|
|
# .Name, .Size, .URL, .ModTime, .IsDir, .IsSymlink
|
|
|
|
handle /files/* {
|
|
root * /var/www/files
|
|
file_server browse {
|
|
index off
|
|
browse {
|
|
template_file /home/exedev/projects/agentic-semantic-web/packs/caddy/browse.html
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
# ── Option B: Default Caddy browse (quick, no custom template) ────────────────
|
|
#
|
|
# Uses Caddy's built-in file browser. Functional but unstyled.
|
|
# Upgrade to Option A when you want ASW aesthetics.
|
|
#
|
|
# handle /files/* {
|
|
# root * /var/www/files
|
|
# file_server browse
|
|
# }
|
|
|
|
|
|
# ── Example: expose the ASW repo itself for browsing ─────────────────────────
|
|
#
|
|
# example.com {
|
|
# handle /asw/browse/* {
|
|
# uri strip_prefix /asw/browse
|
|
# root * /home/exedev/projects/agentic-semantic-web
|
|
# file_server browse {
|
|
# browse {
|
|
# template_file /home/exedev/projects/agentic-semantic-web/packs/caddy/browse.html
|
|
# }
|
|
# }
|
|
# }
|
|
# }
|