1{{- /*gotype: github.com/antonmedv/gitmal/pkg/templates.BlobParams */ -}}
 2{{ define "head" }}
 3    <style>
 4        {{ .CSS }}
 5
 6        [id] {
 7          scroll-margin-top: var(--header-height);
 8        }
 9
10        pre {
11          border: 1px solid var(--c-border);
12          border-top: none;
13          border-bottom-left-radius: var(--border-radius);
14          border-bottom-right-radius: var(--border-radius);
15        }
16
17        pre {
18          margin: 0;
19          padding: 8px 16px;
20          overflow-x: auto;
21          white-space: pre;
22          word-spacing: normal;
23          word-break: normal;
24          word-wrap: normal;
25          tab-size: 4;
26          font-family: var(--font-family-mono), monospace;
27        }
28
29        pre > code {
30          display: block;
31          padding: 0 16px;
32          width: fit-content;
33          min-width: 100%;
34          line-height: var(--code-line-height);
35          font-size: var(--code-font-size);
36        }
37
38        .border {
39          border: 1px solid var(--c-border);
40          border-top: none;
41          border-bottom-left-radius: 6px;
42          border-bottom-right-radius: 6px;
43        }
44
45        .binary-file {
46          padding: 8px 16px;
47          font-style: italic;
48        }
49
50        .image {
51          padding: 8px 16px;
52          text-align: center;
53        }
54
55        .image img {
56          max-width: 100%;
57          height: auto;
58        }
59    </style>
60{{ end }}
61
62{{ define "body" }}
63    {{ template "header" . }}
64    {{ if .IsImage }}
65        <div class="image border">{{.Content}}</div>
66    {{ else if .IsBinary}}
67        <div class="binary-file border">Binary file</div>
68    {{ else }}
69        {{ .Content }}
70    {{ end }}
71{{ end }}
72