update main for imports
This commit is contained in:
parent
103cd7dcac
commit
7ac987fa42
1 changed files with 6 additions and 5 deletions
11
main.go
11
main.go
|
@ -13,6 +13,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gohugoio/hugo/config"
|
"github.com/gohugoio/hugo/config"
|
||||||
|
"github.com/n0x1m/hugoext/hugov0492"
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -157,14 +158,14 @@ type File struct {
|
||||||
NewBody []byte
|
NewBody []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
func parse(fullpath string) ([]byte, *Content, error) {
|
func parse(fullpath string) ([]byte, *hugov0492.Content, error) {
|
||||||
file, err := os.Open(fullpath)
|
file, err := os.Open(fullpath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
page, err := ReadFrom(file)
|
page, err := hugov0492.ReadFrom(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -189,7 +190,7 @@ func destinationPath(file *File, pattern string) error {
|
||||||
file.Body = body
|
file.Body = body
|
||||||
|
|
||||||
if file.Parent != "." {
|
if file.Parent != "." {
|
||||||
link, err := pathPattern(pattern).Expand(c)
|
link, err := hugov0492.PathPattern(pattern).Expand(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -234,8 +235,8 @@ func collectFiles(fullpath string, filechan chan File) error {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewContentFromMeta(meta map[string]interface{}) *Content {
|
func NewContentFromMeta(meta map[string]interface{}) *hugov0492.Content {
|
||||||
return &Content{
|
return &hugov0492.Content{
|
||||||
Title: stringFromInterface(meta["title"]),
|
Title: stringFromInterface(meta["title"]),
|
||||||
Slug: stringFromInterface(meta["slug"]),
|
Slug: stringFromInterface(meta["slug"]),
|
||||||
Summary: stringFromInterface(meta["summary"]),
|
Summary: stringFromInterface(meta["summary"]),
|
||||||
|
|
Loading…
Reference in a new issue