Parcourir la source

Fix #191 outdated documentation

Javier Provecho Fernandez il y a 11 ans
Parent
commit
2d1291329a
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      README.md

+ 6 - 1
README.md

@@ -321,7 +321,7 @@ Using LoadHTMLTemplates()
 ```go
 func main() {
 	r := gin.Default()
-	r.LoadHTMLTemplates("templates/*")
+	r.LoadHTMLGlob("templates/*")
 	r.GET("/index", func(c *gin.Context) {
 		obj := gin.H{"title": "Main website"}
 		c.HTML(200, "index.tmpl", obj)
@@ -331,6 +331,11 @@ func main() {
 	r.Run(":8080")
 }
 ```
+```html
+<h1>
+	{{ .title }}
+</h1>
+```
 
 You can also use your own html template render