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