Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorJoel Scoble <joel.scoble@outlook.com>2014-11-06 19:06:29 +0300
committerspf13 <steve.francia@gmail.com>2014-11-14 06:36:28 +0300
commit4f2dfe7015635f19aeb88924769b25b5e0c60358 (patch)
treef80fe59587694f7aacb772dc068fa880a9d97775 /target
parent7badd2eb0c4a300f8cbbf88b9ec83cd31f193598 (diff)
converted path 2 filepath
Diffstat (limited to 'target')
-rw-r--r--target/file.go6
-rw-r--r--target/htmlredirect.go4
-rw-r--r--target/page.go14
3 files changed, 12 insertions, 12 deletions
diff --git a/target/file.go b/target/file.go
index 37851cae2..ea023d2bb 100644
--- a/target/file.go
+++ b/target/file.go
@@ -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
}
diff --git a/target/htmlredirect.go b/target/htmlredirect.go
index 6ccfb73d3..d2fb5f527 100644
--- a/target/htmlredirect.go
+++ b/target/htmlredirect.go
@@ -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 {
diff --git a/target/page.go b/target/page.go
index 32bb56ded..924037402 100644
--- a/target/page.go
+++ b/target/page.go
@@ -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 {