-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fcc39e
commit f507a31
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
# (G)o (h)ome(p)age | ||
GHP is a FastCGI auto-indexer similar to the NGINX Auto-index | ||
feature, but allows for fully customisable index pages via Go Templates | ||
|
||
## Installation | ||
This is a very dumb single-file program. Install it wherever you like :D | ||
For use with Nginx, see the [sample nginx config](sample.nginx.conf) | ||
|
||
## Usage | ||
Just run `ghp`! | ||
|
||
`ghp -h` for full list of config options | ||
|
||
|
||
### Writing index files | ||
Index files are written and rendered as [Go Templates](https://golang.org/pkg/text/template/). | ||
The currently-served directory's contents are passed as data to the index with the type `[]os.FileInfo`, and can be referenced with `.`. | ||
For more detail, see [an example](samples/index.gohtml) | ||
|
||
### Additional util functions | ||
|
||
- `Request`: Get the current request (*http.Request) | ||
|
||
- `BaseURL( *http.Request )`: returns the current request's `URL.Path`, formatted for use with the HTML `<base>` tag | ||
|