import (
"io"
- "path"
+ "path/filepath"
"github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/hugofs"
}
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 {
}
func filename(f string) string {
- ext := path.Ext(f)
+ ext := filepath.Ext(f)
if ext == "" {
return f
}
import (
"bytes"
"html/template"
- "path"
+ "path/filepath"
"strings"
"github.com/spf13/hugo/helpers"
} 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 {
"fmt"
"html/template"
"io"
- "path"
+ "path/filepath"
"github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/hugofs"
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 {