Skip to content

Commit 5a081a4

Browse files
committed
add html title
1 parent 735d04d commit 5a081a4

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

assets/css/03_layout.css

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,32 @@ body {
1818
margin: 0 auto;
1919
}
2020

21+
footer {
22+
grid-area: footer;
23+
gap: 2px;
24+
font-size: var(--fsize-xxs);
25+
border-top: 1px solid var(--border);
26+
border-bottom: none;
27+
font-style: italic;
28+
color: var(--fg-1);
29+
}
30+
2131
nav {
2232
grid-area: nav;
23-
display: flex;
24-
gap: 6px;
25-
flex-direction: row;
26-
align-content: center; /* vertical align */
27-
align-items: center;
28-
justify-content: center;
29-
justify-items: center;
30-
padding: 0.5rem 0.5rem 0.5rem 1rem;
31-
background-color: var(--bg-1);
32-
border-bottom: 1px solid var(--border);
3333
}
3434

35+
nav,
3536
footer {
36-
grid-area: footer;
3737
display: flex;
38-
gap: 18px;
38+
gap: 6px;
3939
flex-direction: row;
4040
align-content: center; /* vertical align */
4141
align-items: center;
4242
justify-content: center;
43-
justify-items: stretch;
43+
justify-items: center;
4444
padding: 0.5rem 0.5rem 0.5rem 1rem;
45-
font-size: var(--fsize-xxs);
4645
background-color: var(--bg-1);
47-
border-top: 1px solid var(--border);
48-
font-style: italic;
49-
color: var(--fg-1);
46+
border-bottom: 1px solid var(--border);
5047
}
5148

5249
nav div {

assets/templates/layout/main_layout.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<link rel="stylesheet" href="/static/style.css">
1313
<link rel="stylesheet" href="/static/vendor/prism.css">
1414
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
15-
<title>{{ .Title }}</title>
15+
<title>{{- if .Title -}}{{- .Title -}}{{ else }}Varnishlog Parser{{- end -}}</title>
1616
</head>
1717

1818
<body hx-ext="response-targets">
@@ -49,9 +49,9 @@
4949
</div>
5050

5151
<footer>
52-
<div>Varnishlog Parser</div>
53-
5452
<div>
53+
Varnishlog Parser
54+
5555
<a rel="nofollow noopener"
5656
target="_blank"
5757
href="https://github.com/aorith/varnishlog-parser"

internal/server/html/html.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package html
44

55
import (
66
"bytes"
7+
"fmt"
78
"io"
89
"log/slog"
910
"net/http"
@@ -103,6 +104,7 @@ func Parsed(w http.ResponseWriter, data PageData) error {
103104
}
104105
data.Transactions.GroupCount = len(ts.GroupRelatedTransactions())
105106
data.Logs.Raw = ts.RawLog()
107+
data.Title = fmt.Sprintf("%d txs parsed", data.Transactions.Count)
106108

107109
return executeTemplate(w, parsed, "main_layout.html", data)
108110
}

0 commit comments

Comments
 (0)