diff options
author | Noah Campbell <noahcampbell@gmail.com> | 2013-09-12 21:48:59 +0400 |
---|---|---|
committer | Noah Campbell <noahcampbell@gmail.com> | 2013-09-12 21:48:59 +0400 |
commit | 74b55fc7c87f2887c42ce8626cb461fee5d7b907 (patch) | |
tree | fd071f824ac14cff6ddaf9c9582a65843a6ab316 /target | |
parent | 998b2f73f8da8886be87c29e23623d24445cbe93 (diff) |
Normalize paths within hugo
filepath was used inconsistently throughout the hugolib. With the
introduction of source and target modules, all path are normalized to
"/". This simplifies the processing of paths. It does mean that
contributors need to be aware of using path/filepath in any module other
than source or target is not recommended. The current exception is
hugolib/config.go
Diffstat (limited to 'target')
-rw-r--r-- | target/file_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/target/file_test.go b/target/file_test.go index ee474c1c4..1ac1f3c79 100644 --- a/target/file_test.go +++ b/target/file_test.go @@ -14,6 +14,8 @@ func TestFileTranslator(t *testing.T) { {"foo", "foo/index.html"}, {"foo.html", "foo/index.html"}, {"foo.xhtml", "foo/index.xhtml"}, + {"section", "section/index.html"}, + {"section/", "section/index.html"}, {"section/foo", "section/foo/index.html"}, {"section/foo.html", "section/foo/index.html"}, {"section/foo.rss", "section/foo/index.rss"}, @@ -34,7 +36,7 @@ func TestFileTranslator(t *testing.T) { func TestFileTranslatorBase(t *testing.T) { tests := []struct { - content string + content string expected string }{ {"/", "a/base/index.html"}, @@ -64,6 +66,7 @@ func TestTranslateUglyUrls(t *testing.T) { }{ {"foo.html", "foo.html"}, {"/", "index.html"}, + {"section", "section.html"}, {"index.html", "index.html"}, } |