mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-28 11:23:01 +00:00
hugolib: Fix false WARNINGs in lang prefix check
Add a slash to the check to make it less likely to match a valid value. Fixes #5860
This commit is contained in:
parent
49d0a82641
commit
7881b0965f
1 changed files with 1 additions and 1 deletions
|
@ -381,7 +381,7 @@ func (pm *pageMeta) setMetadata(p *pageState, frontmatter map[string]interface{}
|
||||||
return fmt.Errorf("URLs with protocol (http*) not supported: %q. In page %q", url, p.pathOrTitle())
|
return fmt.Errorf("URLs with protocol (http*) not supported: %q. In page %q", url, p.pathOrTitle())
|
||||||
}
|
}
|
||||||
lang := p.s.GetLanguagePrefix()
|
lang := p.s.GetLanguagePrefix()
|
||||||
if lang != "" && !strings.HasPrefix(url, "/") && strings.HasPrefix(url, lang) {
|
if lang != "" && !strings.HasPrefix(url, "/") && strings.HasPrefix(url, lang+"/") {
|
||||||
if strings.HasPrefix(hugo.CurrentVersion.String(), "0.55") {
|
if strings.HasPrefix(hugo.CurrentVersion.String(), "0.55") {
|
||||||
// We added support for page relative URLs in Hugo 0.55 and
|
// We added support for page relative URLs in Hugo 0.55 and
|
||||||
// this may get its language path added twice.
|
// this may get its language path added twice.
|
||||||
|
|
Loading…
Reference in a new issue