生成的html文件,替换.md,而不是在后面添加
This commit is contained in:
2
build.go
2
build.go
@@ -30,7 +30,7 @@ func (self *Visitor) visit(path string, f os.FileInfo, err error) error {
|
|||||||
input, _ := ioutil.ReadAll(file)
|
input, _ := ioutil.ReadAll(file)
|
||||||
output := blackfriday.MarkdownCommon(input)
|
output := blackfriday.MarkdownCommon(input)
|
||||||
var out *os.File
|
var out *os.File
|
||||||
if out, err = os.Create(f.Name() + ".html"); err != nil {
|
if out, err = os.Create(strings.Replace(f.Name(),".md",".html",-1) ); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error creating %s: %v", f.Name(), err)
|
fmt.Fprintf(os.Stderr, "Error creating %s: %v", f.Name(), err)
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user