Skip to content

Commit 7af9831

Browse files
feat: links to repo
1 parent 416679b commit 7af9831

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

internal/build/build.go

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ type Build struct {
55
Commit string
66
Date string
77
Version string
8+
RepoURL string
89
}
910

1011
var Current Build
12+
13+
var RepoURL string = "https://github.com/ItsNotGoodName/smtpbridge"

web/helpers/helpers.go

+4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ import (
66
"io"
77
"time"
88

9+
"github.com/ItsNotGoodName/smtpbridge/internal/build"
910
"github.com/ItsNotGoodName/smtpbridge/web"
1011
"github.com/dustin/go-humanize"
1112
)
1213

1314
var Map template.FuncMap = template.FuncMap{
15+
"repoURL": func() string {
16+
return build.RepoURL
17+
},
1418
"development": func() bool {
1519
return web.Development
1620
},

web/views/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h2>Build</h2>
3232
</tr>
3333
<tr>
3434
<th scope="row"><strong>Commit</strong></th>
35-
<td>{{.Build.Commit}}</td>
35+
<td><a href="{{repoURL}}/tree/{{.Build.Commit}}">{{.Build.Commit}}</a></td>
3636
</tr>
3737
<tr>
3838
<th scope="row"><strong>Date</strong></th>
@@ -65,7 +65,7 @@ <h2>Retention Policy</h2>
6565
</tr>
6666
{{end}}
6767
<tr>
68-
<th scope="row"><strong>Min Envelope Age</strong></th>
68+
<th scope="row"><strong>Minimum Envelope Age</strong></th>
6969
<td>{{.RetentionPolicy.MinEnvelopeAge}}</td>
7070
</tr>
7171
{{if .RetentionPolicy.AttachmentSize}}

web/views/p/footer.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<footer class="container">
22
<small>Built with <a href="https://picocss.com">Pico</a>
3-
<a href="https://github.com/ItsNotGoodName/smtpbridge">Source code</a></small>
3+
<a href="{{repoURL}}">Source code</a>
4+
<a href="{{repoURL}}/blob/master/LICENSE">License</a>
5+
</small>
46
</footer>

0 commit comments

Comments
 (0)