-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fileserver: Extract default browse template into a separate file #4417
Conversation
Note that this PR uses the file embedding capability introduced in Go 1.16, but Caddy currently requires at least that version to build, so that should be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, I was thinking of doing this change at some point, but you got to it first 😄
Unfortunate that we lose git history from moving the contents to another file, but we gain from syntax highlighting etc.
We'll also need to update the docs once merged to link to the .html
file instead. See https://caddyserver.com/docs/caddyfile/directives/file_server
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.
Thanks, I didn't know there was a reference to the template. I opened caddyserver/website#196. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this. It'll be our first time using go:embed features, so we'll give it a shot!
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.