From 579747d0f75788b142c3a415991b2607d8f6d8f8 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 29 Jan 2019 08:28:59 +1100 Subject: [PATCH] update basic templates to use a frontend dir --- cmd/templates/basic/frontend/main.html | 8 ++++++++ cmd/templates/basic/main.go.template | 14 +++++--------- cmd/templates/custom/frontend/main.html | 8 ++++++++ cmd/templates/custom/main.go.template | 17 +++++++---------- 4 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 cmd/templates/basic/frontend/main.html create mode 100644 cmd/templates/custom/frontend/main.html diff --git a/cmd/templates/basic/frontend/main.html b/cmd/templates/basic/frontend/main.html new file mode 100644 index 000000000..927697544 --- /dev/null +++ b/cmd/templates/basic/frontend/main.html @@ -0,0 +1,8 @@ +
+ +

Basic Template

+ Welcome to your basic Wails app! +
diff --git a/cmd/templates/basic/main.go.template b/cmd/templates/basic/main.go.template index b1b37b72d..662a546bb 100644 --- a/cmd/templates/basic/main.go.template +++ b/cmd/templates/basic/main.go.template @@ -1,25 +1,21 @@ package main import ( + "github.com/gobuffalo/packr" wails "github.com/wailsapp/wails" ) -var html = ` -
- -

Basic Template

-Welcome to your basic Wails app! -
-` - func main() { + // Assets + assets := packr.NewBox("./frontend") + // Initialise the app app := wails.CreateApp(&wails.AppConfig{ Width: 1024, Height: 768, Title: "{{.Name}}", - HTML: html, + HTML: wails.BoxString(&assets, "main.html"), }) app.Run() } diff --git a/cmd/templates/custom/frontend/main.html b/cmd/templates/custom/frontend/main.html new file mode 100644 index 000000000..927697544 --- /dev/null +++ b/cmd/templates/custom/frontend/main.html @@ -0,0 +1,8 @@ +
+ +

Basic Template

+ Welcome to your basic Wails app! +
diff --git a/cmd/templates/custom/main.go.template b/cmd/templates/custom/main.go.template index d23e2cd9b..662a546bb 100644 --- a/cmd/templates/custom/main.go.template +++ b/cmd/templates/custom/main.go.template @@ -1,24 +1,21 @@ package main import ( + "github.com/gobuffalo/packr" wails "github.com/wailsapp/wails" ) -var html = ` -
-

Custom

-Welcome to your basic Wails app with added CSS! -
-` - func main() { + // Assets + assets := packr.NewBox("./frontend") + // Initialise the app app := wails.CreateApp(&wails.AppConfig{ - Width: 800, - Height: 600, + Width: 1024, + Height: 768, Title: "{{.Name}}", - HTML: html, + HTML: wails.BoxString(&assets, "main.html"), }) app.Run() }