Improve errors template

This commit is contained in:
BBaoVanC 2021-11-19 17:33:05 -06:00
parent 7edc8e4b81
commit 0a33eae1fc
1 changed files with 9 additions and 8 deletions

View File

@ -1,27 +1,28 @@
{{ $code := placeholder "http.error.status_code" -}}
{{ $text := placeholder "http.error.status_text" -}}
{{ $full_text := printf "%s %s" (placeholder "http.error.status_code") (placeholder "http.error.status_text") -}}
{{ $host := placeholder "http.request.host" -}}
{{ $img_url := (printf "https://errors.bbaovanc.com/%s.jpg" $code) -}}
<html>
<head>
<title>{{ $code }} {{ $text }}</title>
<title>{{ $full_text }}</title>
<meta name="title" content="{{ $code }} {{ $text }}" />
<meta name="description" content="{{ $code }} {{ $text }}" />
<meta name="title" content="{{ $full_text }}" />
<meta name="description" content="{{ $full_text }}" />
<meta property="og:title" content="{{ $code }} {{ $text }}" />
<meta property="og:description" content="{{ $code }} {{ $text }}" />
<meta property="og:title" content="{{ $full_text }}" />
<meta property="og:description" content="{{ $full_text }}" />
<meta property="og:image" content="{{ $img_url }}"/>
<meta property="og:site_name" content="{{ $host }}" />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:image" content="{{ $img_url }}"/>
<meta name="twitter:title" content="{{ $code }} {{ $text }}" />
<meta name="twitter:description" content="{{ $code }} {{ $text }}" />
<meta name="twitter:title" content="{{ $full_text }}" />
<meta name="twitter:description" content="{{ $full_text }}" />
</head>
<body bgcolor="black" text="white">
<center>
<h1>{{ $code }} {{ $text }}</h1>
<h1>{{ $full_text }}</h1>
<img src='{{ $img_url }}' alt="cat" />
</center>
</body>