mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
hugolib: Fix ref/relref issue with duplicate base filenames
This commit also makes that function 80x faster. Fixes #2507
This commit is contained in:
@@ -427,13 +427,7 @@ func (s *SiteInfo) refLink(ref string, page *Page, relative bool, outputFormat s
|
||||
var link string
|
||||
|
||||
if refURL.Path != "" {
|
||||
for _, page := range s.AllRegularPages {
|
||||
refPath := filepath.FromSlash(refURL.Path)
|
||||
if page.Source.Path() == refPath || page.Source.LogicalName() == refPath {
|
||||
target = page
|
||||
break
|
||||
}
|
||||
}
|
||||
target := s.getPage(KindPage, refURL.Path)
|
||||
|
||||
if target == nil {
|
||||
return "", fmt.Errorf("No page found with path or logical name \"%s\".\n", refURL.Path)
|
||||
|
Reference in New Issue
Block a user