Skip to content

Commit

Permalink
confetti-framework#108 load templates with embed
Browse files Browse the repository at this point in the history
  • Loading branch information
Reindert Vetter committed Apr 6, 2021
1 parent b0ff295 commit e5bc1cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions config/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ var Path = struct {
Public: filepath.Join(basePath(), "public"),
Storage: filepath.Join(basePath(), "storage"),
Resource: filepath.Join(basePath(), "resources"),
Lang: filepath.Join(basePath(), "resources", "lang"),
Views: filepath.Join(basePath(), "resources", "views"),
}

func basePath() string {
Expand Down
6 changes: 3 additions & 3 deletions resources/views/homepage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

//go:embed homepage.gohtml
var homepageHtml string
var homepageTemplate string

// Homepage provide the homepage view
func Homepage(app inter.App, title string, description string) *HomepageView {
Expand All @@ -24,7 +24,7 @@ type HomepageView struct {
Locale string
}

// Template returns the template path
// Template returns the content of the template
func (h HomepageView) Template() string {
return homepageHtml
return homepageTemplate
}

0 comments on commit e5bc1cd

Please sign in to comment.