aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2020-03-08 10:52:41 +0000
committerFelix Hanley <felix@userspace.com.au>2020-03-08 10:52:41 +0000
commitf878deb0f3033495637e85533a52369491fa6104 (patch)
tree572b2ec8dff4525a322729e20bcd6c070f8436f2
parent58ec0bacb661f705b02db9bb584a551d1864f71a (diff)
downloadsws-f878deb0f3033495637e85533a52369491fa6104.tar.gz
sws-f878deb0f3033495637e85533a52369491fa6104.tar.bz2
Move templates and allow overriding
-rw-r--r--Makefile10
-rw-r--r--cmd/server/flags.go11
-rw-r--r--cmd/server/main.go2
-rw-r--r--cmd/server/routes.go11
-rw-r--r--go.mod4
-rw-r--r--go.sum32
-rw-r--r--scripts/gen.go (renamed from templates/gen.go)6
-rw-r--r--static/default.css2
-rw-r--r--static/gen.go19
-rw-r--r--tmpl/charts.tmpl (renamed from templates/charts.tmpl)0
-rw-r--r--tmpl/example.tmpl (renamed from templates/example.tmpl)0
-rw-r--r--tmpl/flash.tmpl (renamed from templates/flash.tmpl)0
-rw-r--r--tmpl/home.tmpl (renamed from templates/home.tmpl)0
-rw-r--r--tmpl/layouts/base.tmpl (renamed from templates/layouts/base.tmpl)0
-rw-r--r--tmpl/layouts/public.tmpl (renamed from templates/layouts/public.tmpl)0
-rw-r--r--tmpl/login.tmpl (renamed from templates/login.tmpl)0
-rw-r--r--tmpl/navbar.tmpl (renamed from templates/navbar.tmpl)0
-rw-r--r--tmpl/site.tmpl (renamed from templates/site.tmpl)0
-rw-r--r--tmpl/sites.tmpl (renamed from templates/sites.tmpl)0
-rw-r--r--tmpl/timerange.tmpl (renamed from templates/timerange.tmpl)0
-rw-r--r--tmpl/user.tmpl (renamed from templates/user.tmpl)0
21 files changed, 32 insertions, 65 deletions
diff --git a/Makefile b/Makefile
index 4e8f321..6d44224 100644
--- a/Makefile
+++ b/Makefile
@@ -6,9 +6,8 @@ SQL= $(shell find sql -type f)
EXTRAS= cmd/server/migrations.go \
counter/sws.min.js \
cmd/server/counter.go \
- cmd/server/static.go \
cmd/server/templates.go
-TMPL= $(shell find templates -type f -name '*.tmpl')
+TMPL= $(shell find tmpl -type f -name '*.tmpl')
STATIC= $(shell find static -type f)
.PHONY: build
@@ -17,11 +16,8 @@ build: $(BINARY)
dist/%: $(SRC) $(EXTRAS)
go build -ldflags "-X main.Version=$(VERSION)" -o $@ ./cmd/$*
-cmd/server/static.go: $(STATIC)
- go generate ./static >$@
-
-cmd/server/templates.go: $(TMPL)
- go generate ./templates >$@
+cmd/server/templates.go: $(TMPL) $(STATIC)
+ go generate ./scripts >$@
cmd/server/migrations.go: $(SQL)
go generate ./sql >$@
diff --git a/cmd/server/flags.go b/cmd/server/flags.go
index 5d83dc2..b64bed1 100644
--- a/cmd/server/flags.go
+++ b/cmd/server/flags.go
@@ -6,15 +6,18 @@ import (
)
func stringFlag(long, short, def, envvar, desc string) *string {
- out := flag.String(long, def, desc)
- if short != "" {
- flag.StringVar(out, short, def, desc)
- }
if envvar != "" {
if v := os.Getenv(envvar); v != "" {
def = v
}
}
+ out := flag.String(long, def, desc)
+ if short != "" {
+ flag.StringVar(out, short, def, desc)
+ }
+ if out != nil && *out == "" {
+ return nil
+ }
return out
}
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 900ef25..309e11b 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -28,6 +28,7 @@ var (
dsn *string
domain *string
logFile *string
+ override *string
noMigrate *bool
)
@@ -37,6 +38,7 @@ func init() {
dsn = stringFlag("dsn", "", "file:sws.db?cache=shared", "DSN", "database password")
domain = stringFlag("domain", "", "stats.userspace.com.au", "DOMAIN", "stats domain")
logFile = stringFlag("log", "", "", "LOGFILE", "log to file")
+ override = stringFlag("override", "", "", "OVERRIDE", "override path")
noMigrate = boolFlag("no-migrate", "m", false, "NOMIGRATE", "disable migrations")
// Default to no log
diff --git a/cmd/server/routes.go b/cmd/server/routes.go
index c8d0264..7c6f37e 100644
--- a/cmd/server/routes.go
+++ b/cmd/server/routes.go
@@ -27,7 +27,13 @@ func createRouter(db sws.Store) (chi.Router, error) {
tmplsAuthed := append(tmplsCommon, []string{"layouts/base.tmpl", "charts.tmpl", "timerange.tmpl"}...)
tmplsPublic := append(tmplsCommon, "layouts/public.tmpl")
- tmpls, err := LoadHTMLTemplateMap(map[string][]string{
+ if override != nil {
+ loadOverrider = func(s string) string {
+ return filepath.Join(*override, s)
+ }
+ }
+
+ tmpls, err := loadHTMLTemplateMap(map[string][]string{
"sites": append([]string{"sites.tmpl"}, tmplsAuthed...),
"site": append([]string{"site.tmpl"}, tmplsAuthed...),
"home": append([]string{"home.tmpl"}, tmplsPublic...),
@@ -74,7 +80,8 @@ func createRouter(db sws.Store) (chi.Router, error) {
r.Get("/*", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
p := strings.TrimPrefix(r.URL.Path, "/")
- if b, err := StaticLoadTemplate(p); err == nil {
+ debug("loading", p)
+ if b, err := loadTemplate(p); err == nil {
name := filepath.Base(p)
http.ServeContent(w, r, name, time.Now(), bytes.NewReader(b))
}
diff --git a/go.mod b/go.mod
index f4d8015..893b803 100644
--- a/go.mod
+++ b/go.mod
@@ -22,9 +22,9 @@ require (
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect
google.golang.org/appengine v1.6.5 // indirect
src.userspace.com.au/go-migrate v0.0.0-20200208102934-cf11cf76db3f
- src.userspace.com.au/templates v0.0.0-20200220030259-5089e411d858
+ src.userspace.com.au/templates v0.0.0-20200308073907-e96b7a1f2a49
)
-replace src.userspace.com.au/templates => ../templates
+//replace src.userspace.com.au/templates => ../templates
go 1.13
diff --git a/go.sum b/go.sum
index 1d46f37..ceff1a9 100644
--- a/go.sum
+++ b/go.sum
@@ -1,14 +1,7 @@
-github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
-github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
-github.com/antchfx/htmlquery v1.0.0/go.mod h1:MS9yksVSQXls00iXkiMqXr0J+umL/AmxXKuP28SUJM8=
-github.com/antchfx/xmlquery v1.0.0/go.mod h1:/+CnyD/DzHRnv2eRxrVbieRU/FIF6N0C+7oTtyUtCKk=
-github.com/antchfx/xpath v1.0.0/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
github.com/blend/go-sdk v2.0.0+incompatible h1:FL9X/of4ZYO5D2JJNI4vHrbXPfuSDbUa7h8JP9+E92w=
github.com/blend/go-sdk v2.0.0+incompatible/go.mod h1:3GUb0YsHFNTJ6hsJTpzdmCUl05o8HisKjx5OAlzYKdw=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/go-chi/chi v4.0.3+incompatible h1:gakN3pDJnzZN5jqFV2TEdF66rTfKeITyR8qu6ekICEY=
@@ -17,8 +10,6 @@ github.com/go-chi/jwtauth v4.0.4+incompatible h1:LGIxg6YfvSBzxU2BljXbrzVc1fMlgqS
github.com/go-chi/jwtauth v4.0.4+incompatible/go.mod h1:Q5EIArY/QnD6BdS+IyDw7B2m6iNbnPxtfd6/BcmtWbs=
github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
-github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
-github.com/gocolly/colly/v2 v2.0.1/go.mod h1:ePrRZlJcLTU2C/f8pJzXfkdBtBDHL5hOaKLcBoiJcq8=
github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
@@ -28,10 +19,8 @@ github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 h1:vr3AYkKovP8uR8AvSGGU
github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ=
github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o=
github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
-github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg=
github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
-github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak=
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
@@ -40,51 +29,34 @@ github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJK
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mssola/user_agent v0.5.1 h1:sJUCUozh+j7c0dR2zMIUX5aJjoY/TNo/gXiNujoH5oY=
github.com/mssola/user_agent v0.5.1/go.mod h1:TTPno8LPY3wAIEKRpAtkdMT0f8SE24pLRGPahjCH4uw=
-github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114 h1:Pm6R878vxWWWR+Sa3ppsLce/Zq+JNTs6aVvRu13jv9A=
github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/speps/go-hashids v2.0.0+incompatible h1:kSfxGfESueJKTx0mpER9Y/1XHl+FVQjtCqRyYcviFbw=
github.com/speps/go-hashids v2.0.0+incompatible/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
-github.com/velebak/colly-sqlite3-storage v0.0.0-20190425160637-c76683d5163d/go.mod h1:+bhXpKXsxEKgCb9gcKEHSQr6XtqlcIoklUyeZMGS4Fw=
github.com/wcharczuk/go-chart v2.0.1+incompatible h1:0pz39ZAycJFF7ju/1mepnk26RLVLBCWz1STcD3doU0A=
github.com/wcharczuk/go-chart v2.0.1+incompatible/go.mod h1:PF5tmL4EIx/7Wf+hEkpCqYi5He4u90sw+0+6FhrryuE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/image v0.0.0-20200119044424-58c23975cae1 h1:5h3ngYt7+vXCDZCup/HkCQgW5XwmSvR/nA2JmJ0RErg=
golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk=
-golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190606165138-5da285871e9c h1:+EXw7AwNOKzPFXMZ1yNjO40aWCh3PIquJB2fYlv9wcs=
-golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
src.userspace.com.au/go-migrate v0.0.0-20200208102934-cf11cf76db3f h1:Vdn/5kMeLXWfkXF/wm9lioSBASBn02aA5DeVjLAYjLM=
src.userspace.com.au/go-migrate v0.0.0-20200208102934-cf11cf76db3f/go.mod h1:QaSWOcvGubR8TBPs8XgLN67muYgAKnmIgHAaQk5ZR1c=
+src.userspace.com.au/templates v0.0.0-20200308073907-e96b7a1f2a49 h1:xKLfGVLhd+jTT5Z1jCIEGcr5LzzuRnpaYvU5pA/iD7I=
+src.userspace.com.au/templates v0.0.0-20200308073907-e96b7a1f2a49/go.mod h1:lB6Vdw9R/8jR8CzvPxfQ8ryBwpNDni1fCdeRjj90gxA=
diff --git a/templates/gen.go b/scripts/gen.go
index 3db4356..eb56bd5 100644
--- a/templates/gen.go
+++ b/scripts/gen.go
@@ -3,6 +3,7 @@ package main
//go:generate go run gen.go
import (
+ "fmt"
"os"
"src.userspace.com.au/templates"
@@ -12,6 +13,11 @@ func main() {
tmpl := templates.Must(templates.New(
templates.EnableHTMLTemplates(),
templates.Extensions([]string{".tmpl"}),
+ templates.Map([]templates.Mapping{
+ {Base: "../", Source: "tmpl"},
+ {Base: "../", Source: "static", Extensions: []string{".css", ".js"}},
+ }),
+ templates.Logger(func(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }),
))
if _, err := tmpl.WriteTo(os.Stdout); err != nil {
panic(err)
diff --git a/static/default.css b/static/default.css
index ffe6d8c..b0ba4a4 100644
--- a/static/default.css
+++ b/static/default.css
@@ -24,7 +24,7 @@ ul {
outline: 1px solid red;
}
.sidebar {
- flex: 0 0 12em;
+ flex: 0 0 13em;
order: -1;
outline: 1px solid red;
}
diff --git a/static/gen.go b/static/gen.go
deleted file mode 100644
index 1699cb2..0000000
--- a/static/gen.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package main
-
-//go:generate go run gen.go
-
-import (
- "os"
-
- "src.userspace.com.au/templates"
-)
-
-func main() {
- tmpl := templates.Must(templates.New(
- templates.FunctionPrefix("Static"),
- templates.Extensions([]string{".css", ".js"}),
- ))
- if _, err := tmpl.WriteTo(os.Stdout); err != nil {
- panic(err)
- }
-}
diff --git a/templates/charts.tmpl b/tmpl/charts.tmpl
index b02d3b7..b02d3b7 100644
--- a/templates/charts.tmpl
+++ b/tmpl/charts.tmpl
diff --git a/templates/example.tmpl b/tmpl/example.tmpl
index 5da849a..5da849a 100644
--- a/templates/example.tmpl
+++ b/tmpl/example.tmpl
diff --git a/templates/flash.tmpl b/tmpl/flash.tmpl
index 2a5a7cf..2a5a7cf 100644
--- a/templates/flash.tmpl
+++ b/tmpl/flash.tmpl
diff --git a/templates/home.tmpl b/tmpl/home.tmpl
index 956c589..956c589 100644
--- a/templates/home.tmpl
+++ b/tmpl/home.tmpl
diff --git a/templates/layouts/base.tmpl b/tmpl/layouts/base.tmpl
index 8986909..8986909 100644
--- a/templates/layouts/base.tmpl
+++ b/tmpl/layouts/base.tmpl
diff --git a/templates/layouts/public.tmpl b/tmpl/layouts/public.tmpl
index eb3e64a..eb3e64a 100644
--- a/templates/layouts/public.tmpl
+++ b/tmpl/layouts/public.tmpl
diff --git a/templates/login.tmpl b/tmpl/login.tmpl
index 8547d2c..8547d2c 100644
--- a/templates/login.tmpl
+++ b/tmpl/login.tmpl
diff --git a/templates/navbar.tmpl b/tmpl/navbar.tmpl
index 99dba68..99dba68 100644
--- a/templates/navbar.tmpl
+++ b/tmpl/navbar.tmpl
diff --git a/templates/site.tmpl b/tmpl/site.tmpl
index 3fcd5fb..3fcd5fb 100644
--- a/templates/site.tmpl
+++ b/tmpl/site.tmpl
diff --git a/templates/sites.tmpl b/tmpl/sites.tmpl
index c7a2002..c7a2002 100644
--- a/templates/sites.tmpl
+++ b/tmpl/sites.tmpl
diff --git a/templates/timerange.tmpl b/tmpl/timerange.tmpl
index b58fc36..b58fc36 100644
--- a/templates/timerange.tmpl
+++ b/tmpl/timerange.tmpl
diff --git a/templates/user.tmpl b/tmpl/user.tmpl
index eaa1733..eaa1733 100644
--- a/templates/user.tmpl
+++ b/tmpl/user.tmpl