mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-19 03:26:57 +00:00
Allow serving custom error page (#393)
It might be useful for those self-hosting a Codeberg Pages instance to be able to serve a different error page than the one embedded with go:embed Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/393 Co-authored-by: Gnarwhal <git.aspect893@passmail.net> Co-committed-by: Gnarwhal <git.aspect893@passmail.net>
This commit is contained in:
parent
bef866faae
commit
23a8e83e80
3 changed files with 33 additions and 6 deletions
|
@ -84,6 +84,15 @@ This will trigger a build of the PR which will build a docker image to be used f
|
|||
- `PAGES_DOMAIN` (default: `codeberg.page`): main domain for pages.
|
||||
- `RAW_DOMAIN` (default: `raw.codeberg.page`): domain for raw resources (must be subdomain of `PAGES_DOMAIN`).
|
||||
|
||||
### Custom Error Page
|
||||
|
||||
A custom error page template can be served by creating `custom/error.html`.
|
||||
Data available to the template includes:
|
||||
|
||||
- `{{ .StatusCode }}`: The HTTP status code (e.g. 404)
|
||||
- `{{ .StatusText }}`: The textual name associated with the status code (e.g. Not Found)
|
||||
- `{{ .Message }}`: The reason for the error
|
||||
|
||||
## Contributing to the development
|
||||
|
||||
The Codeberg team is very open to your contribution.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue