Allow hidden .READMEs
This commit is contained in:
parent
32eef4aa2e
commit
b27dfdcf5d
1 changed files with 1 additions and 9 deletions
|
@ -315,13 +315,5 @@ func IsMarkupFile(name, markup string) bool {
|
||||||
// Note that the '.' should be provided in ext, e.g ".md"
|
// Note that the '.' should be provided in ext, e.g ".md"
|
||||||
func IsReadmeFile(name string, ext ...string) bool {
|
func IsReadmeFile(name string, ext ...string) bool {
|
||||||
name = strings.ToLower(name)
|
name = strings.ToLower(name)
|
||||||
if len(ext) > 0 {
|
return name == "readme" || strings.Index(name, "readme.") == 0 || strings.Index(name, ".readme.") == 0
|
||||||
return name == "readme"+ext[0]
|
|
||||||
}
|
|
||||||
if len(name) < 6 {
|
|
||||||
return false
|
|
||||||
} else if len(name) == 6 {
|
|
||||||
return name == "readme"
|
|
||||||
}
|
|
||||||
return name[:7] == "readme."
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue