mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
node to page: Handle URLs
This includes removing the error return value from Permalink and RelPermalink. We ignore that error all over the place, so we might as well remove it. Updates #2297
This commit is contained in:
@@ -299,13 +299,9 @@ func (s *SiteInfo) refLink(ref string, page *Page, relative bool) (string, error
|
||||
}
|
||||
|
||||
if relative {
|
||||
link, err = target.RelPermalink()
|
||||
link = target.RelPermalink()
|
||||
} else {
|
||||
link, err = target.Permalink()
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
link = target.Permalink()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,11 +385,8 @@ func (s *SiteInfo) SourceRelativeLink(ref string, currentPage *Page) (string, er
|
||||
return "", fmt.Errorf("No page found for \"%s\" on page \"%s\".\n", ref, currentPage.Source.Path())
|
||||
}
|
||||
|
||||
link, err = target.RelPermalink()
|
||||
link = target.RelPermalink()
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
if refURL.Fragment != "" {
|
||||
|
Reference in New Issue
Block a user