mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
@@ -1940,18 +1940,11 @@ func (p *Page) addLangPathPrefixIfFlagSet(outfile string, should bool) string {
|
||||
}
|
||||
|
||||
func sectionsFromDir(dirname string) []string {
|
||||
sections := strings.Split(dirname, helpers.FilePathSeparator)
|
||||
if len(sections) == 1 {
|
||||
if sections[0] == "" {
|
||||
return nil
|
||||
}
|
||||
return sections
|
||||
dirname = strings.Trim(dirname, helpers.FilePathSeparator)
|
||||
if dirname == "" {
|
||||
return nil
|
||||
}
|
||||
if len(sections) > 1 && sections[0] == "" {
|
||||
return sections[1:]
|
||||
}
|
||||
|
||||
return sections
|
||||
return strings.Split(dirname, helpers.FilePathSeparator)
|
||||
}
|
||||
|
||||
const (
|
||||
|
Reference in New Issue
Block a user