before crazy
This commit is contained in:
parent
3436d87b1f
commit
a8fd1a1c40
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-eqiv="content-type" content="text/html;charset=utf-8">
|
||||
<title>Go by Example: {{.Name}}</title>
|
||||
<link rel=stylesheet href="../template/site.css">
|
||||
<link rel=stylesheet href="site.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="chapter" id="{{.Id}}">
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-eqiv="content-type" content="text/html;charset=utf-8">
|
||||
<title>Go by Example</title>
|
||||
<link rel=stylesheet href="../template/site.css">
|
||||
<link rel=stylesheet href="site.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="intro">
|
||||
|
@ -28,6 +28,15 @@ func ensureDir(dir string) {
|
||||
check(err)
|
||||
}
|
||||
|
||||
func copyFile(src, dst string) {
|
||||
srcF, err := os.Open(src, os.O_RDONLY, 0)
|
||||
check(err)
|
||||
dstF, err := os.Create(dst)
|
||||
check(err)
|
||||
err = io.Copy(srcF, dstF)
|
||||
check(err)
|
||||
}
|
||||
|
||||
func pipe(bin string, arg []string, src string) []byte {
|
||||
cmd := exec.Command(bin, arg...)
|
||||
in, _ := cmd.StdinPipe()
|
||||
@ -222,6 +231,7 @@ func renderChapters(chapters []*Chapter) {
|
||||
|
||||
func main() {
|
||||
ensureDir(siteDir)
|
||||
copyFile("template/site.css", siteDir+"/site.css")
|
||||
chapters := parseChapters()
|
||||
renderIndex(chapters)
|
||||
renderChapters(chapters)
|
||||
|
Loading…
x
Reference in New Issue
Block a user