delete some code
parent
d7dcff28ac
commit
eee53cf492
|
@ -4,7 +4,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"io"
|
|
||||||
"main/tools"
|
"main/tools"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -30,13 +29,7 @@ func LoadPosts(dir string) (Posts, error) {
|
||||||
}
|
}
|
||||||
if !f.IsDir() && strings.HasSuffix(f.Name(), ".md") {
|
if !f.IsDir() && strings.HasSuffix(f.Name(), ".md") {
|
||||||
|
|
||||||
file, err := os.Open(path)
|
md, err := os.ReadFile(path)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
md, err := io.ReadAll(file)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue