diff --git a/README.md b/README.md
index e84fa340..d26c45d5 100644
--- a/README.md
+++ b/README.md
@@ -439,6 +439,7 @@ func main() {
router.Run(":8080")
}
```
+templates/index.tmpl
```html
@@ -447,6 +448,46 @@ func main() {
```
+Using templates with same name in different directories
+
+```go
+func main() {
+ router := gin.Default()
+ router.LoadHTMLGlob("templates/**/*")
+ router.GET("/posts/index", func(c *gin.Context) {
+ c.HTML(http.StatusOK, "posts/index.tmpl", gin.H{
+ "title": "Posts",
+ })
+ })
+ router.GET("/users/index", func(c *gin.Context) {
+ c.HTML(http.StatusOK, "users/index.tmpl", gin.H{
+ "title": "Users",
+ })
+ })
+ router.Run(":8080")
+}
+```
+templates/posts/index.tmpl
+```html
+{{ define "posts/index.tmpl" }}
+
+ {{ .title }}
+
+
Using posts/index.tmpl
+
+{{ end }}
+```
+templates/users/index.tmpl
+```html
+{{ define "users/index.tmpl" }}
+
+ {{ .title }}
+
+Using users/index.tmpl
+
+{{ end }}
+```
+
You can also use your own html template render
```go