WARNING: make non-relative ref/relref page reference(s) in page

Hi,

I’ve done some digging and can’t seem to find an answer. Upon updating Hugo I’m now getting the following console warning:

WARNING: make non-relative ref/relref page reference(s) in page

The errors relate to how I’m linking to internal pages in my md files, which isas below

"The penultimate stage of this website development process involves recreating the visual page designs. I’ll do this using HTML 5, CSS 3 and a selection of my own chosen [website technologies](/about/web-development-technologies)."

I’m linking like this as I have BlackFriday hrefTargetBlank = true for external links and using the ref shortcode would open internal links in a new tab too if I was not to use this method.

Any ideas or pointers would be greatly appreciated as the console is being flooded with warnings as of now!

Not really, sorry. The text snippet that you share seems fine Markdown, even though the last slash / is missing from the URL. But that doesn’t give all the errors, probably.

Can you share more information so that it’s easier for us to help you? :slight_smile:

Did you try using the ref or relref shortcodes? I’m not sure if that format works, more info here

Did you ever solve this issue?

I get the same warning message even though I do not use ref and relref nowhere in my site. I even get this warning for empty (asides from a front matter) _index.md files:

WARNING: make non-relative ref/relref page reference(s) in page "/csharp/_index.md" absolute, e.g. {{< ref "/blog/my-post.md" >}}

Contents of that _index.md file:

---
title: C#
description: Overview of all articles
pagetitle: C# articles
weight: 10
layout: mainsection
---

The error is generated by this Hugo source code, although I’m not sure what that means.

hugo env
Hugo Static Site Generator v0.54.0/extended windows/amd64 BuildDate: unknown
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.11.5"

I think This warning also include GetPage use. Do you have a GetPage référence this warning could apply ?

1 Like

Thanks for the quick reply and the smart comment. You’re right, this error can also be triggered by .GetPage.

I had this in my theme earlier:

{{ $secPage := .GetPage .Section }}

But it should have been:

{{ $secPage := .Site.GetPage .Section }}

Here’s the doc page for .GetPage if other people find this thread when searching for the error message.

Thanks again Regis. :slight_smile:

1 Like