From e988045d87f1a413daca3affb8bb381f1eb9d297 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Mon, 3 Jun 2019 20:43:32 -0400 Subject: adding version to index template --- assets/tmpl/index.html | 4 ++-- init.go | 1 + types.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/tmpl/index.html b/assets/tmpl/index.html index 15856f7..509107b 100644 --- a/assets/tmpl/index.html +++ b/assets/tmpl/index.html @@ -3,7 +3,7 @@ - + {{.Name}} - twtxt Registry @@ -34,7 +34,7 @@ /api/plain/mentions /api/plain/tweets /api/plain/tags -

All queries accept ?page=N as a parameter, returning sets of 20 results. +

All queries accept ?page=N as a parameter, returning groups of 20 results. This may be omitted for the first page of results.

Query by user:

$ curl '{{.URL}}/api/plain/users?q=foo'
diff --git a/init.go b/init.go
index d3881dc..eacbea4 100644
--- a/init.go
+++ b/init.go
@@ -156,6 +156,7 @@ func initConfig() {
 	confObj.LastPush = time.Now()
 	confObj.Version = getwtxt
 
+	confObj.Instance.Vers = getwtxt
 	confObj.Instance.Name = viper.GetString("Instance.SiteName")
 	confObj.Instance.URL = viper.GetString("Instance.URL")
 	confObj.Instance.Owner = viper.GetString("Instance.OwnerName")
diff --git a/types.go b/types.go
index 5032c5a..16f3c55 100644
--- a/types.go
+++ b/types.go
@@ -27,6 +27,7 @@ type Configuration struct {
 
 // Instance refers to this specific instance of getwtxt
 type Instance struct {
+	Vers  string `json:"-"`
 	Name  string `json:"Instance.SiteName"`
 	URL   string `json:"Instance.URL"`
 	Owner string `json:"Instance.OwnerName"`
-- 
cgit 1.4.1-2-gfad0

ue='range'>range





blob: 3b1986b71a0c451fae15a897ec07ea9fc5e5a31e (plain) (blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69