From 7ac987fa42dfe577ef9d607a269e16d64428e11d Mon Sep 17 00:00:00 2001 From: dre Date: Sun, 11 Jul 2021 00:46:01 +0800 Subject: [PATCH] update main for imports --- main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 5e34637..ecdbe54 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,7 @@ import ( "time" "github.com/gohugoio/hugo/config" + "github.com/n0x1m/hugoext/hugov0492" "github.com/spf13/afero" ) @@ -157,14 +158,14 @@ type File struct { NewBody []byte } -func parse(fullpath string) ([]byte, *Content, error) { +func parse(fullpath string) ([]byte, *hugov0492.Content, error) { file, err := os.Open(fullpath) if err != nil { return nil, nil, err } defer file.Close() - page, err := ReadFrom(file) + page, err := hugov0492.ReadFrom(file) if err != nil { return nil, nil, err } @@ -189,7 +190,7 @@ func destinationPath(file *File, pattern string) error { file.Body = body if file.Parent != "." { - link, err := pathPattern(pattern).Expand(c) + link, err := hugov0492.PathPattern(pattern).Expand(c) if err != nil { return err } @@ -234,8 +235,8 @@ func collectFiles(fullpath string, filechan chan File) error { }) } -func NewContentFromMeta(meta map[string]interface{}) *Content { - return &Content{ +func NewContentFromMeta(meta map[string]interface{}) *hugov0492.Content { + return &hugov0492.Content{ Title: stringFromInterface(meta["title"]), Slug: stringFromInterface(meta["slug"]), Summary: stringFromInterface(meta["summary"]),