diff --git a/page/page.go b/page/page.go index 08e29d4..4560382 100644 --- a/page/page.go +++ b/page/page.go @@ -1,39 +1,44 @@ /* * Copyright © 2018 A Bunch Tell LLC. * * This file is part of WriteFreely. * * WriteFreely is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, included * in the LICENSE file in this source code package. */ // package page provides mechanisms and data for generating a WriteFreely page. package page import ( "github.com/writeas/writefreely/config" "strings" ) type StaticPage struct { // App configuration config.AppCfg Version string HeaderNav bool // Request values Path string Username string Values map[string]string Flashes []string } // SanitizeHost alters the StaticPage to contain a real hostname. This is // especially important for the Tor hidden service, as it can be served over // proxies, messing up the apparent hostname. func (sp *StaticPage) SanitizeHost(cfg *config.Config) { if cfg.Server.HiddenHost != "" && strings.HasPrefix(sp.Host, cfg.Server.HiddenHost) { sp.Host = cfg.Server.HiddenHost } } + +func (sp StaticPage) OfficialVersion() string { + p := strings.Split(sp.Version, "-") + return p[0] +} diff --git a/templates/include/footer.tmpl b/templates/include/footer.tmpl index b7291bf..e92878a 100644 --- a/templates/include/footer.tmpl +++ b/templates/include/footer.tmpl @@ -1,36 +1,36 @@ {{define "footer"}}
{{if .SingleUser}} {{else}}

{{.SiteName}}

{{end}} {{end}} diff --git a/templates/user/include/footer.tmpl b/templates/user/include/footer.tmpl index 62cc571..36a69fa 100644 --- a/templates/user/include/footer.tmpl +++ b/templates/user/include/footer.tmpl @@ -1,36 +1,36 @@ {{define "footer"}} {{template "foot" .}} {{template "body-end" .}} {{end}} {{define "foot"}} {{end}} {{define "body-end"}} {{end}}