How can I connect a standalone markdown file internally in Hugo?

I created a standalone Markdown page here called (Live:

And I am trying to connect it to my homepage

This is the shortcode:

Here is my CV: [html]{{< ref "" >}} and {{% staticref "/manab_cv.pdf" %}}(PDF){{% /staticref %}}

But as you can see it on my homepage (, the page is not being linked correctly:

Here is my CV: [html]/cv/ and (PDF)

How can I link it?

You have a syntax error with the way you’re using ref


Hint: Don’t forget the dot.

I tried [html]{{< ref . "" >}}

But Netlify build is showing this error:

4:51:30 PM: ERROR 2018/03/26 22:51:30 home/ unrecognized character in shortcode action: U+002E '.'. Note: Parameters with non-alphanumeric args must be quoted
4:51:30 PM: ERROR 2018/03/26 22:51:30 error processing shortcode "_internal/shortcodes/ref.html" for page "home/": template: _internal/shortcodes/ref.html:1:89: executing "_internal/shortcodes/ref.html" at <0>: invalid value; expected string

The internal Hugo shortcode has this syntax {{ ref . "" }} hence the error. You need to remove the angle brackets.

Also you don’t need to type [html]

Thank you.

Now I have this:

### Here is my CV: {{ ref . "" }} and {{% staticref "/manab_cv.pdf" %}}(PDF){{% /staticref %}}

But, I still don’t see the link:

Here is my CV: {{ ref . “” }} and (PDF)

Apologies. I pointed you to the ref function. (I shouldn’t post this late at night)

Here are the Docs examples of the ref internal shortcode

If you’re still having a problem, then please post a link to your Hugo project’s repository.

1 Like

Also, the .md part is optional. This should work: {{< ref "cv" >}}.

Ah, thank you so much! It works now. A quick question - anyway I can force it to open in the same tab? Right now, it’s opening another tab. Happy to open another thread here.

You forgot the parentheses:

[html]({{< ref "cv" >}})

Thanks. I had updated it. And links fine now.

How can I force Hugo to open the link in the same page?

My project directory:

The easiest way is to remove hrefTargetBlank = true from your site config. There’s a bug in how Blackfriday implements that… it basically opens all absolute links in new tab. Search this forum for a recent discussion on that.

1 Like

Thank you so much. I have put hrefTargetBlank = false