diff options
Diffstat (limited to 'page/page.go')
| -rw-r--r-- | page/page.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/page/page.go b/page/page.go index e984383..c926bed 100644 --- a/page/page.go +++ b/page/page.go @@ -29,6 +29,7 @@ import ( "io" "log" "os" + "path/filepath" "text/template" "github.com/russross/blackfriday" @@ -77,7 +78,7 @@ var Logger = log.New(os.Stderr, "", log.LstdFlags) // NewPage returns a page struct with the path populated func NewPage(pth string) *Page { - return &Page{path: pth} + return &Page{path: filepath.FromSlash(filepath.Clean(pth))} } // NewPage Allow for the creation of a new page from the current page, does @@ -90,7 +91,7 @@ func (p Page) NewPage(pth string) *Page { // Useful if you're say iterating across tags to print out a list of // relevant posts on a blog or so by topic. func (p Page) Path() string { - return p.path + return filepath.ToSlash(p.path) } // Global is specifically for use inside of a page markdown file or |
