Go Mustache

1 개요[ | ]

Go Mustache

2 예시1: hello world[ | ]

package main

import "fmt"
import "github.com/cbroglie/mustache"

func main() {
	data, _ := mustache.Render("hello {{c}}", map[string]string{"c": "world"})
	fmt.Println(data)
}
package main

import "fmt"
import "github.com/cbroglie/mustache"

func main() {
	data, _ := mustache.Render("hello {{c}} {{x}}", map[string]string{"c": "world"})
	fmt.Println(data)
}
package main

import "fmt"
import "github.com/cbroglie/mustache"

func main() {
	data, _ := mustache.Render("hello {{c}} {|{x}|}", map[string]string{"c": "world"})
	fmt.Println(data)
}

3 예시2: 파일[ | ]

<html>
<head><title>Hi</title></head>
<body>
{{{content}}}
</body>
</html>
<h1> Hello World! </h1>
package main

import "fmt"
import "github.com/cbroglie/mustache"

func main() {
	data, _ := mustache.RenderFileInLayout("template.html.mustache", "layout.html.mustache", nil)
	fmt.Println(data)
}

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}