error.html (2414B)
1 <!DOCTYPE html>
2 <html class="no-js" lang="">
3 <head>
4 <meta charset="utf-8" />
5 <title>Hugo Server: Error</title>
6 <style type="text/css">
7 body {
8 font-family: "Muli", system-ui, -apple-system, "Segoe UI", Roboto,
9 "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif,
10 "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
11 "Noto Color Emoji";
12 font-size: 14px;
13 background-color: #272a36;
14 }
15 main {
16 max-width: 100ch;
17 padding: 2ch;
18 margin: auto;
19 }
20
21 .version {
22 font-size: 0.75rem;
23 color: #7c7c7c;
24 }
25
26 hr {
27 margin-bottom: 1rem;
28 border: none;
29 height: 1px;
30 background-color: #3d3d3d;
31 }
32 pre,
33 code {
34 white-space: pre-wrap;
35 white-space: -moz-pre-wrap;
36 white-space: -pre-wrap;
37 white-space: -o-pre-wrap;
38 word-wrap: break-word;
39 font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
40 "Courier New", monospace;
41 }
42 .error pre {
43 line-height: 1.5;
44 }
45 .filename {
46 color: #eef78a;
47 font-size: 0.9rem;
48 line-height: 1.5;
49 }
50 .highlight {
51 overflow-x: auto;
52 }
53 a {
54 color: #0594cb;
55 text-decoration: none;
56 }
57 a:hover {
58 color: #ccc;
59 }
60 </style>
61 </head>
62 <body>
63 <main>
64 {{ $codeStyle := "dracula" }}
65 <div class="error">
66 {{ highlight .Error "apl" (printf "linenos=false,noclasses=true,style=%s" $codeStyle ) }}
67 </div>
68 <hr />
69 {{ range $i, $e := .Files }}
70 {{ if not .ErrorContext }}
71 {{ continue }}
72 {{ end }}
73 {{ $params := printf "noclasses=true,style=%s,linenos=table,hl_lines=%d,linenostart=%d" $codeStyle (add .ErrorContext.LinesPos 1) (sub .Position.LineNumber .ErrorContext.LinesPos) }}
74 {{ $lexer := .ErrorContext.ChromaLexer | default "go-html-template" }}
75 {{ with .Position }}
76 <code class="filename"
77 >{{ printf "%s:%d:%d" .Filename .LineNumber .ColumnNumber }}:</code
78 >
79 {{ end }}
80 {{ highlight (delimit .ErrorContext.Lines "\n") $lexer $params }}
81 <hr />
82 {{ end }}
83 <p class="version">{{ .Version }}</p>
84 <a href="">Reload Page</a>
85 </main>
86 </body>
87 </html>