From e81369e2208e47d9650f9699ad8bc7692640b275 Mon Sep 17 00:00:00 2001 From: Jeremy Lin Date: Mon, 15 Nov 2021 10:53:54 -0800 Subject: fileserver: Move default browse template into a separate file (#4417) This makes it easier for users to find the default browse template if they want to create a custom template based on that. It also makes it easier to view the template with proper syntax highlighting. --- modules/caddyhttp/fileserver/browse.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/caddyhttp/fileserver/browse.go') diff --git a/modules/caddyhttp/fileserver/browse.go b/modules/caddyhttp/fileserver/browse.go index 92a1e6e..bd4de3a 100644 --- a/modules/caddyhttp/fileserver/browse.go +++ b/modules/caddyhttp/fileserver/browse.go @@ -16,6 +16,7 @@ package fileserver import ( "bytes" + _ "embed" "encoding/json" "fmt" "net/http" @@ -31,6 +32,9 @@ import ( "go.uber.org/zap" ) +//go:embed browse.html +var defaultBrowseTemplate string + // Browse configures directory browsing. type Browse struct { // Use this template file instead of the default browse template. -- cgit v1.2.3