error-pages/templates
Lars Gerber 940bd0405f
New template orient added (#190)
* added orient theme

* added creation test for orient theme

* Added new Orient theme to CHANGELOG.md

* fix: Template fixed a bit

---------

Co-authored-by: Paramtamtam <7326800+tarampampam@users.noreply.github.com>
2023-04-17 15:06:28 +04:00
..
app-down.html replace google by bunny fonts (#131) 2022-08-19 23:19:10 +04:00
cats.html Added possibility to disable error pages auto-localization (#94) 2022-04-12 15:34:35 +05:00
connection.html replace google by bunny fonts (#131) 2022-08-19 23:19:10 +04:00
ghost.html replace google by bunny fonts (#131) 2022-08-19 23:19:10 +04:00
hacker-terminal.html replace google by bunny fonts (#131) 2022-08-19 23:19:10 +04:00
l7-dark.html replace google by bunny fonts (#131) 2022-08-19 23:19:10 +04:00
l7-light.html replace google by bunny fonts (#131) 2022-08-19 23:19:10 +04:00
lost-in-space.html replace google by bunny fonts (#131) 2022-08-19 23:19:10 +04:00
matrix.html replace google by bunny fonts (#131) 2022-08-19 23:19:10 +04:00
noise.html Added possibility to disable error pages auto-localization (#94) 2022-04-12 15:34:35 +05:00
orient.html New template orient added (#190) 2023-04-17 15:06:28 +04:00
readme.md Added possibility to disable error pages auto-localization (#94) 2022-04-12 15:34:35 +05:00
shuffle.html Added possibility to disable error pages auto-localization (#94) 2022-04-12 15:34:35 +05:00

Templates

Creating templates is a very simple operation, even for those who know nothing at all about Go Template. All you should know is:

  • The template should be one page. Without additional css or js files (but you can load them from the CDN or another GitHub repositories using jsdelivr.com, for example)
  • Don't forget to include <meta name="robots" content="noindex, nofollow" /> tag in the header
  • You can use a special "placeholders" (wrapped in {{ and }}) for the rendering error code, message and others (see details below)

Supported signatures

Error page & request data

Signature Description Example
{{ code }} Error page code 404
{{ message }} Error code message Not found
{{ description }} Error code description The server can not find the requested page
{{ original_uri }} X-Original-URI header value /foo1/bar2
{{ namespace }} X-Namespace header value foo
{{ ingress_name }} X-Ingress-Name header value bar
{{ service_name }} X-Service-Name header value baz
{{ service_port }} X-Service-Port header value 8080
{{ request_id }} X-Request-ID header value 12AB34CD56EF78
{{ forwarded_for }} X-Forwarded-For header value 203.0.113.195, 70.41.3.18
{{ host }} Host header value example.com
{{ now.Unix }} Current timestamp (e.g. in Unix format) 1643621927
{{ hostname }} OS hostname ab12cd34ef56
{{ version }} Application version 2.5.0
{{ if show_details }}...{{ end }} Logical operator (server started with "show details" option?)
{{ if hide_details }}...{{ end }} Same as above, but inverted
{{ if l10n_enabled }}...{{ end }} Logical operator (l10n is enabled?)
{{ if l10n_disabled }}...{{ end }} Same as above, but inverted

Modifiers

Signature Description Example
{{ ... | json }} Convert value into json-string {{ code | json }}
{{ ... | int }} Convert value into integer {{ code | int }}