mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
rewriting guessSection to accurately reflect intent and usage. Update tests.
This commit is contained in:
@@ -423,17 +423,20 @@ func TestGuessSection(t *testing.T) {
|
||||
{"", ""},
|
||||
{"/content", ""},
|
||||
{"content/", ""},
|
||||
{"/content/", "content"},
|
||||
{"/content/", ""}, // /content/ is a special case. It will never be the section
|
||||
{"/blog", ""},
|
||||
{"/blog/", "blog"},
|
||||
{"blog", ""},
|
||||
{"content/blog", ""},
|
||||
{"/content/blog/", "blog"},
|
||||
{"/content/blog", "blog"},
|
||||
{"content/blog/", ""},
|
||||
{"/content/blog", ""}, // Lack of trailing slash indicates 'blog' is not a directory.
|
||||
{"content/blog/", "blog"},
|
||||
{"/contents/myblog/", "contents"},
|
||||
{"/contents/yourblog", "contents"},
|
||||
{"/contents/ourblog/", "contents"},
|
||||
{"/content/myblog/", "myblog"},
|
||||
{"/content/yourblog", ""},
|
||||
{"/content/ourblog/", "ourblog"},
|
||||
}
|
||||
|
||||
for i, d := range data {
|
||||
|
Reference in New Issue
Block a user