mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
all: Rename Unmormalized => Unnormalized
This commit is contained in:
parent
7f82461407
commit
53f204310e
7 changed files with 12 additions and 12 deletions
|
@ -359,8 +359,8 @@ func (p *Path) Path() (d string) {
|
||||||
return p.norm(p.s)
|
return p.norm(p.s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unmormalized returns the Path with the original case preserved.
|
// Unnormalized returns the Path with the original case preserved.
|
||||||
func (p *Path) Unmormalized() *Path {
|
func (p *Path) Unnormalized() *Path {
|
||||||
return p.unnormalized
|
return p.unnormalized
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ func TestParse(t *testing.T) {
|
||||||
"Basic text file, mixed case and spaces, unnormalized",
|
"Basic text file, mixed case and spaces, unnormalized",
|
||||||
"/a/Foo BAR.txt",
|
"/a/Foo BAR.txt",
|
||||||
func(c *qt.C, p *Path) {
|
func(c *qt.C, p *Path) {
|
||||||
pp := p.Unmormalized()
|
pp := p.Unnormalized()
|
||||||
c.Assert(pp, qt.IsNotNil)
|
c.Assert(pp, qt.IsNotNil)
|
||||||
c.Assert(pp.BaseNameNoIdentifier(), qt.Equals, "Foo BAR")
|
c.Assert(pp.BaseNameNoIdentifier(), qt.Equals, "Foo BAR")
|
||||||
},
|
},
|
||||||
|
|
|
@ -1554,7 +1554,7 @@ func (sa *sitePagesAssembler) assembleResources() error {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
relPathOriginal := rs.path.Unmormalized().PathRel(ps.m.pathInfo.Unmormalized())
|
relPathOriginal := rs.path.Unnormalized().PathRel(ps.m.pathInfo.Unnormalized())
|
||||||
relPath := rs.path.BaseRel(ps.m.pathInfo)
|
relPath := rs.path.BaseRel(ps.m.pathInfo)
|
||||||
|
|
||||||
var targetBasePaths []string
|
var targetBasePaths []string
|
||||||
|
@ -1759,7 +1759,7 @@ func (sa *sitePagesAssembler) addMissingRootSections() error {
|
||||||
seen[section] = true
|
seen[section] = true
|
||||||
|
|
||||||
// Try to preserve the original casing if possible.
|
// Try to preserve the original casing if possible.
|
||||||
sectionUnnormalized := p.Unmormalized().Section()
|
sectionUnnormalized := p.Unnormalized().Section()
|
||||||
pth := sa.s.Conf.PathParser().Parse(files.ComponentFolderContent, "/"+sectionUnnormalized+"/_index.md")
|
pth := sa.s.Conf.PathParser().Parse(files.ComponentFolderContent, "/"+sectionUnnormalized+"/_index.md")
|
||||||
nn := w.Tree.Get(pth.Base())
|
nn := w.Tree.Get(pth.Base())
|
||||||
|
|
||||||
|
|
|
@ -502,7 +502,7 @@ func (h *HugoSites) handleDataFile(r *source.File) error {
|
||||||
|
|
||||||
// Crawl in data tree to insert data
|
// Crawl in data tree to insert data
|
||||||
current = h.data
|
current = h.data
|
||||||
dataPath := r.FileInfo().Meta().PathInfo.Unmormalized().Dir()[1:]
|
dataPath := r.FileInfo().Meta().PathInfo.Unnormalized().Dir()[1:]
|
||||||
keyParts := strings.Split(dataPath, "/")
|
keyParts := strings.Split(dataPath, "/")
|
||||||
|
|
||||||
for _, key := range keyParts {
|
for _, key := range keyParts {
|
||||||
|
|
|
@ -195,7 +195,7 @@ func (p *pageMeta) Name() string {
|
||||||
return p.resourcePath
|
return p.resourcePath
|
||||||
}
|
}
|
||||||
if p.pageConfig.Kind == kinds.KindTerm {
|
if p.pageConfig.Kind == kinds.KindTerm {
|
||||||
return p.pathInfo.Unmormalized().BaseNameNoIdentifier()
|
return p.pathInfo.Unnormalized().BaseNameNoIdentifier()
|
||||||
}
|
}
|
||||||
return p.Title()
|
return p.Title()
|
||||||
}
|
}
|
||||||
|
@ -742,7 +742,7 @@ func (p *pageMeta) applyDefaultValues() error {
|
||||||
case kinds.KindHome:
|
case kinds.KindHome:
|
||||||
p.pageConfig.Title = p.s.Title()
|
p.pageConfig.Title = p.s.Title()
|
||||||
case kinds.KindSection:
|
case kinds.KindSection:
|
||||||
sectionName := p.pathInfo.Unmormalized().BaseNameNoIdentifier()
|
sectionName := p.pathInfo.Unnormalized().BaseNameNoIdentifier()
|
||||||
if p.s.conf.PluralizeListTitles {
|
if p.s.conf.PluralizeListTitles {
|
||||||
sectionName = flect.Pluralize(sectionName)
|
sectionName = flect.Pluralize(sectionName)
|
||||||
}
|
}
|
||||||
|
@ -754,7 +754,7 @@ func (p *pageMeta) applyDefaultValues() error {
|
||||||
panic("term not set")
|
panic("term not set")
|
||||||
}
|
}
|
||||||
case kinds.KindTaxonomy:
|
case kinds.KindTaxonomy:
|
||||||
p.pageConfig.Title = strings.Replace(p.s.conf.C.CreateTitle(p.pathInfo.Unmormalized().BaseNameNoIdentifier()), "-", " ", -1)
|
p.pageConfig.Title = strings.Replace(p.s.conf.C.CreateTitle(p.pathInfo.Unnormalized().BaseNameNoIdentifier()), "-", " ", -1)
|
||||||
case kinds.KindStatus404:
|
case kinds.KindStatus404:
|
||||||
p.pageConfig.Title = "404 Page not found"
|
p.pageConfig.Title = "404 Page not found"
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,8 +116,8 @@ func createTargetPathDescriptor(p *pageState) (page.TargetPathDescriptor, error)
|
||||||
pageInfoPage := p.PathInfo()
|
pageInfoPage := p.PathInfo()
|
||||||
pageInfoCurrentSection := p.CurrentSection().PathInfo()
|
pageInfoCurrentSection := p.CurrentSection().PathInfo()
|
||||||
if p.s.Conf.DisablePathToLower() {
|
if p.s.Conf.DisablePathToLower() {
|
||||||
pageInfoPage = pageInfoPage.Unmormalized()
|
pageInfoPage = pageInfoPage.Unnormalized()
|
||||||
pageInfoCurrentSection = pageInfoCurrentSection.Unmormalized()
|
pageInfoCurrentSection = pageInfoCurrentSection.Unnormalized()
|
||||||
}
|
}
|
||||||
|
|
||||||
desc := page.TargetPathDescriptor{
|
desc := page.TargetPathDescriptor{
|
||||||
|
|
|
@ -130,7 +130,7 @@ func (fi *File) pathToDir(s string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fi *File) p() *paths.Path {
|
func (fi *File) p() *paths.Path {
|
||||||
return fi.fim.Meta().PathInfo.Unmormalized()
|
return fi.fim.Meta().PathInfo.Unnormalized()
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewFileInfoFrom(path, filename string) *File {
|
func NewFileInfoFrom(path, filename string) *File {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue