aboutsummaryrefslogtreecommitdiff
blob: 16a0b5fc517d9d365766deee26a2b35357d49ac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package about

import "net/http"
import "runtime/debug"
import "soko/pkg/app/layout"
import "soko/pkg/config"

func getCommitId() string {
	if info, ok := debug.ReadBuildInfo(); ok {
		for _, setting := range info.Settings {
			if setting.Key == "vcs.revision" {
				return setting.Value
			}
		}
	}
	return ""
}

templ index() {
	<div class="container mb-5">
		<div class="row">
			<div class="col-12 text-center">
				<h1 class="px-3 pt-5 pb-1" style="font-size: 3em;">About packages.gentoo.org</h1>
				<span style="font-size: 90%;" class="text-muted">
					Feel free to <a href="/about/feedback">get in touch</a> { "if" } you have any questions that are not answered on this page.
					<br/>
					And welcome to the new packages.gentoo.org!
				</span>
			</div>
			<div class="col-12 mt-5 pt-4">
				<h2>FAQ</h2>
				<dl>
					<dt>Which version is currently running?</dt>
					<dd>
						if commitId := getCommitId(); commitId == "" {
							Currently { config.Version() } is running.
						} else {
							Currently { config.Version() } is running, based on commit <a href={ templ.URL("https://gitweb.gentoo.org/sites/soko.git/commit/?id=" + commitId) }>{ commitId[:8] }</a>.
						}
					</dd>
					<br/>
					<dt>How often is the site updated?</dt>
					<dd>
						Updates are scheduled <strong>every 5 minutes now</strong>.
						You can find the last time an import task was started in the footer.
					</dd>
				</dl>
			</div>
		</div>
	</div>
}

// Index shows the landing page of the about pages
func Index(w http.ResponseWriter, r *http.Request) {
	layout.Layout("About", layout.About, index()).Render(r.Context(), w)
}