mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
Fix various Windows-issues
File handling was broken on Windows. This commit contains a revision of the path handling with separation of file paths and urls where needed. There may be remaining issues and there may be better ways to do this, but it is easier to start that refactoring job with a set of passing tests. Fixes #687 Fixes #660
This commit is contained in:
parent
3a8c12418a
commit
9f77f93071
19 changed files with 205 additions and 137 deletions
|
@ -69,14 +69,14 @@ func TestUrlPrep(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestPretty(t *testing.T) {
|
||||
assert.Equal(t, PrettifyPath("/section/name.html"), "/section/name/index.html")
|
||||
assert.Equal(t, PrettifyPath("/section/sub/name.html"), "/section/sub/name/index.html")
|
||||
assert.Equal(t, PrettifyPath("/section/name/"), "/section/name/index.html")
|
||||
assert.Equal(t, PrettifyPath("/section/name/index.html"), "/section/name/index.html")
|
||||
assert.Equal(t, PrettifyPath("/index.html"), "/index.html")
|
||||
assert.Equal(t, PrettifyPath("/name.xml"), "/name/index.xml")
|
||||
assert.Equal(t, PrettifyPath("/"), "/")
|
||||
assert.Equal(t, PrettifyPath(""), "/")
|
||||
assert.Equal(t, PrettifyUrlPath("/section/name.html"), "/section/name/index.html")
|
||||
assert.Equal(t, PrettifyUrlPath("/section/sub/name.html"), "/section/sub/name/index.html")
|
||||
assert.Equal(t, PrettifyUrlPath("/section/name/"), "/section/name/index.html")
|
||||
assert.Equal(t, PrettifyUrlPath("/section/name/index.html"), "/section/name/index.html")
|
||||
assert.Equal(t, PrettifyUrlPath("/index.html"), "/index.html")
|
||||
assert.Equal(t, PrettifyUrlPath("/name.xml"), "/name/index.xml")
|
||||
assert.Equal(t, PrettifyUrlPath("/"), "/")
|
||||
assert.Equal(t, PrettifyUrlPath(""), "/")
|
||||
assert.Equal(t, PrettifyUrl("/section/name.html"), "/section/name")
|
||||
assert.Equal(t, PrettifyUrl("/section/sub/name.html"), "/section/sub/name")
|
||||
assert.Equal(t, PrettifyUrl("/section/name/"), "/section/name")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue