Add version number

This commit is contained in:
Andinus 2020-03-27 22:20:25 +05:30
parent 248dff015b
commit 79b376a659
Signed by: andinus
GPG Key ID: B67D55D482A799FD
4 changed files with 11 additions and 1 deletions

6
core/version.go Normal file
View File

@ -0,0 +1,6 @@
package core
// Version will return the current version.
func Version() string {
return "v0.1.0"
}

View File

@ -9,4 +9,5 @@ type Page struct {
Error []string
Success []string
Notice []string
Version string
}

View File

@ -8,12 +8,13 @@ import (
"strings"
"tildegit.org/andinus/perseus/auth"
"tildegit.org/andinus/perseus/core"
"tildegit.org/andinus/perseus/storage/sqlite3"
)
// HandleRegister handles /register pages.
func HandleRegister(w http.ResponseWriter, r *http.Request, db *sqlite3.DB) {
p := Page{}
p := Page{Version: core.Version()}
p.Notice = []string{
"Only [a-z] & [0-9] allowed for username",
"Password length must be greater than 8 characters",

View File

@ -45,6 +45,8 @@
 / 
<a href="https://andinus.nand.sh/perseus">Perseus</a>
<span style="float:right">
Perseus {{ .Version }}
&nbsp;/&nbsp;
<a href="https://tildegit.org/andinus/perseus">
Source Code
</a>