Last active
July 15, 2018 15:22
-
-
Save nqthqn/49a88371c9cc139ac61726703034e578 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name = "Hello" | |
Testing = ["1", "2", "3"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"html/template" | |
"io/ioutil" | |
"os" | |
"github.com/BurntSushi/toml" | |
) | |
func main() { | |
var r map[string]interface{} | |
bs, err := ioutil.ReadFile("./config.toml") | |
if err != nil { | |
fmt.Println("config.toml issue:", err) | |
} | |
if toml.Unmarshal(bs, &r) != nil { | |
fmt.Println("Unmarshaling issue:", err) | |
} | |
t, err := template.ParseFiles("./view.html") | |
if err != nil { | |
fmt.Println("view.html template parse issue:", err) | |
} | |
f := os.Stdout | |
if t.Execute(f, r) != nil { | |
fmt.Println("template exectution issue:", err) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>{{.Name}}</h1> | |
<ul> | |
{{range .Testing}} | |
<li>{{.}}</li>{{end}} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prints to standard out.
Spec
dist/
foo/[foo.scss, foo.html, foo.config]
todist/modules/foo/[foo_.html]
wherefoo_.html
has rendered foo.config values inside of it and is affected by thefoo.scss
module