Skip to content

Commit

Permalink
Fix example in README.md (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
logarithm authored and appleboy committed Sep 22, 2017
1 parent 71fc5d1 commit bbc6daf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ func main() {
func loadTemplates(templatesDir string) multitemplate.Render {
r := multitemplate.New()

layouts, err := filepath.Glob(templatesDir + "layouts/*.tmpl")
layouts, err := filepath.Glob(templatesDir + "/layouts/*.tmpl")
if err != nil {
panic(err.Error())
}

includes, err := filepath.Glob(templatesDir + "includes/*.tmpl")
includes, err := filepath.Glob(templatesDir + "/includes/*.tmpl")
if err != nil {
panic(err.Error())
}

// Generate our templates map from our layouts/ and includes/ directories
for _, layout := range layouts {
files := append(includes, layout)
files := append([]string{layout}, includes...)
r.Add(filepath.Base(layout), template.Must(template.ParseFiles(files...)))
}
return r
Expand Down

0 comments on commit bbc6daf

Please sign in to comment.