converted path 2 filepath
authorJoel Scoble <joel.scoble@outlook.com>
Thu, 6 Nov 2014 16:06:29 +0000 (10:06 -0600)
committerspf13 <steve.francia@gmail.com>
Fri, 14 Nov 2014 03:36:28 +0000 (22:36 -0500)
target/file.go
target/htmlredirect.go
target/page.go

index 37851cae291b1f7d8cf15015ad4625bea19730a8..ea023d2bba32ada12aa104715d54fdb25481eece 100644 (file)
@@ -2,7 +2,7 @@ package target
 
 import (
        "io"
-       "path"
+       "path/filepath"
 
        "github.com/spf13/hugo/helpers"
        "github.com/spf13/hugo/hugofs"
@@ -35,7 +35,7 @@ func (fs *Filesystem) Publish(path string, r io.Reader) (err error) {
 }
 
 func (fs *Filesystem) Translate(src string) (dest string, err error) {
-       return path.Join(fs.PublishDir, src), nil
+       return filepath.Join(fs.PublishDir, src), nil
 }
 
 func (fs *Filesystem) extension(ext string) string {
@@ -43,7 +43,7 @@ func (fs *Filesystem) extension(ext string) string {
 }
 
 func filename(f string) string {
-       ext := path.Ext(f)
+       ext := filepath.Ext(f)
        if ext == "" {
                return f
        }
index 6ccfb73d3d602a3295efaeebcb59410c13c02e73..d2fb5f527340f0fddef5da313632c75cc3e7d27f 100644 (file)
@@ -3,7 +3,7 @@ package target
 import (
        "bytes"
        "html/template"
-       "path"
+       "path/filepath"
        "strings"
 
        "github.com/spf13/hugo/helpers"
@@ -41,7 +41,7 @@ func (h *HTMLRedirectAlias) Translate(alias string) (aliasPath string, err error
        } else if !strings.HasSuffix(alias, ".html") {
                alias = alias + "/index.html"
        }
-       return path.Join(h.PublishDir, helpers.MakePath(alias)), nil
+       return filepath.Join(h.PublishDir, helpers.MakePath(alias)), nil
 }
 
 type AliasNode struct {
index 32bb56dedf4ac5b7687a8a5044ca334f50b09dc3..924037402ff8bd70f6fd26d91ddee09e26c634fc 100644 (file)
@@ -4,7 +4,7 @@ import (
        "fmt"
        "html/template"
        "io"
-       "path"
+       "path/filepath"
 
        "github.com/spf13/hugo/helpers"
        "github.com/spf13/hugo/hugofs"
@@ -34,23 +34,23 @@ func (pp *PagePub) Publish(path string, r io.Reader) (err error) {
 func (pp *PagePub) Translate(src string) (dest string, err error) {
        if src == "/" {
                if pp.PublishDir != "" {
-                       return path.Join(pp.PublishDir, "index.html"), nil
+                       return filepath.Join(pp.PublishDir, "index.html"), nil
                }
                return "index.html", nil
        }
 
-       dir, file := path.Split(src)
-       ext := pp.extension(path.Ext(file))
+       dir, file := filepath.Split(src)
+       ext := pp.extension(filepath.Ext(file))
        name := filename(file)
        if pp.PublishDir != "" {
-               dir = path.Join(pp.PublishDir, dir)
+               dir = filepath.Join(pp.PublishDir, dir)
        }
 
        if pp.UglyUrls || file == "index.html" {
-               return path.Join(dir, fmt.Sprintf("%s%s", name, ext)), nil
+               return filepath.Join(dir, fmt.Sprintf("%s%s", name, ext)), nil
        }
 
-       return path.Join(dir, name, fmt.Sprintf("index%s", ext)), nil
+       return filepath.Join(dir, name, fmt.Sprintf("index%s", ext)), nil
 }
 
 func (pp *PagePub) extension(ext string) string {