Documentation
¶
Overview ¶
Package dirindex provides functionality for generating directory listings with customizable templates and translations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Translations = map[string]Translation{}/* 164 elements not displayed */
Translations is a map where keys are language codes and values are Translation structs containing localized text.
Functions ¶
func DirIndex ¶
func DirIndex(fsys fs.StatFS, enable bool, basePath, rootPath string) (func(http.Handler) http.Handler, error)
DirIndex creates middleware for handling directory listing in an HTTP file server. If enabled, it generates an HTML page showing the directory's contents using a predefined template. If it is not enabled, a 403-Forbidden is produced instead of the directory listing. The middleware skips directory listing when serving files or paths with index.html present.
Types ¶
Click to show internal directories.
Click to hide internal directories.