mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-12 22:02:33 +03:00
rewriting guessSection to accurately reflect intent and usage. Update tests.
This commit is contained in:
parent
e2634752ce
commit
a40bd3caf1
2 changed files with 24 additions and 20 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue