From d36b6a55c8fa4400cd39de717443e110e990a8a3 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 31 Jul 2021 21:06:27 -0400 Subject: Make the website run on Windows as well --- page/page.go | 5 +++-- 1 file 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 -- cgit v1.2.3