Skip to content

Commit 6d50b43

Browse files
committed
fix templates
1 parent 30b6198 commit 6d50b43

File tree

24 files changed

+74
-1157
lines changed

24 files changed

+74
-1157
lines changed

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ require (
101101
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
102102
github.com/satori/go.uuid v1.2.0
103103
github.com/sergi/go-diff v1.0.0
104-
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b // indirect
105104
github.com/shurcooL/sanitized_anchor_name v0.0.0-20160918041101-1dba4b3954bc // indirect
106-
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
107105
github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d // indirect
108106
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff // indirect
109107
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,8 @@ github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
278278
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
279279
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE=
280280
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
281-
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b h1:4kg1wyftSKxLtnPAvcRWakIPpokB9w780/KwrNLnfPA=
282-
github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
283281
github.com/shurcooL/sanitized_anchor_name v0.0.0-20160918041101-1dba4b3954bc h1:3wIrJvFb3Pf6B/2mDBnN1G5IfUVev4X5apadQlWOczE=
284282
github.com/shurcooL/sanitized_anchor_name v0.0.0-20160918041101-1dba4b3954bc/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
285-
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0=
286-
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
287283
github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d h1:qQWKKOvHN7Q9c6GdmUteCef2F9ubxMpxY1IKwpIKz68=
288284
github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d/go.mod h1:vq0tzqLRu6TS7Id0wMo2N5QzJoKedVeovOpHjnykSzY=
289285
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=

modules/embed/main.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

modules/options/main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"log"
7+
"net/http"
8+
9+
"github.com/shurcooL/vfsgen"
10+
)
11+
12+
func main() {
13+
var fsTemplates http.FileSystem = http.Dir("../../options")
14+
err := vfsgen.Generate(fsTemplates, vfsgen.Options{
15+
PackageName: "options",
16+
BuildTags: "bindata",
17+
VariableName: "Assets",
18+
Filename: "bindata.go",
19+
})
20+
if err != nil {
21+
log.Fatal("%v", err)
22+
}
23+
}

modules/options/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
package options
66

7-
//go:generate go run ../embed/main.go options
7+
//go:generate go run main.go
88
//go:generate go fmt bindata.go
99

1010
type directorySet map[string][]string

modules/public/main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"log"
7+
"net/http"
8+
9+
"github.com/shurcooL/vfsgen"
10+
)
11+
12+
func main() {
13+
var fsPublic http.FileSystem = http.Dir("../../public")
14+
err := vfsgen.Generate(fsPublic, vfsgen.Options{
15+
PackageName: "public",
16+
BuildTags: "bindata",
17+
VariableName: "Assets",
18+
Filename: "bindata.go",
19+
})
20+
if err != nil {
21+
log.Fatal("%v", err)
22+
}
23+
}

modules/public/public.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"gopkg.in/macaron.v1"
1818
)
1919

20-
//go:generate go run ../embed/main.go public
20+
//go:generate go run main.go
2121
//go:generate go fmt bindata.go
2222

2323
// Options represents the available options to configure the macaron handler.

modules/templates/main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"log"
7+
"net/http"
8+
9+
"github.com/shurcooL/vfsgen"
10+
)
11+
12+
func main() {
13+
var fsTemplates http.FileSystem = http.Dir("../../templates")
14+
err := vfsgen.Generate(fsTemplates, vfsgen.Options{
15+
PackageName: "templates",
16+
BuildTags: "bindata",
17+
VariableName: "Assets",
18+
Filename: "bindata.go",
19+
})
20+
if err != nil {
21+
log.Fatal("%v", err)
22+
}
23+
}

modules/templates/static.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func Mailer() *template.Template {
205205
}
206206

207207
func Asset(name string) ([]byte, error) {
208-
f, err := Assets.Open(name)
208+
f, err := Assets.Open("/" + name)
209209
if err != nil {
210210
return nil, err
211211
}
@@ -217,7 +217,7 @@ func AssetNames() []string {
217217
realFS := Assets.(vfsgen۰FS)
218218
var results = make([]string, 0, len(realFS))
219219
for k, _ := range realFS {
220-
results = append(results, k)
220+
results = append(results, k[1:])
221221
}
222222
return results
223223
}

modules/templates/templates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
package templates
66

7-
//go:generate go run ../embed/main.go templates
7+
//go:generate go run main.go
88
//go:generate go fmt bindata.go

0 commit comments

Comments
 (0)