mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
source: Consolidate filepath.Split calls
This commit is contained in:
parent
df44b1930a
commit
21054f730a
1 changed files with 1 additions and 2 deletions
|
@ -92,8 +92,7 @@ func NewFile(relpath string) *File {
|
||||||
relpath: relpath,
|
relpath: relpath,
|
||||||
}
|
}
|
||||||
|
|
||||||
f.dir, _ = filepath.Split(f.relpath)
|
f.dir, f.logicalName = filepath.Split(f.relpath)
|
||||||
_, f.logicalName = filepath.Split(f.relpath)
|
|
||||||
f.ext = strings.TrimPrefix(filepath.Ext(f.LogicalName()), ".")
|
f.ext = strings.TrimPrefix(filepath.Ext(f.LogicalName()), ".")
|
||||||
f.section = helpers.GuessSection(f.Dir())
|
f.section = helpers.GuessSection(f.Dir())
|
||||||
f.uniqueID = helpers.Md5String(f.LogicalName())
|
f.uniqueID = helpers.Md5String(f.LogicalName())
|
||||||
|
|
Loading…
Reference in a new issue