Hello people,
first of all, I hope the following issue was not discussed (many times) before. To my surprise I couldn’t find any threads on the topic.
As the Docs explain, relref
can be used to create links. I have two files in one directory, _index.md
and voraussetzungen.md
. I want to link from the former to the latter, by using [Test]({{< relref "voraussetzungen" >}})
.
What I expected: <a href="RELATIVEPATH">Test</a>
What actually happened: <a><span>Test</span></a>
The individual components do seem to work:
{{< relref "voraussetzungen" >}}
→ /de/inhalte/fedora/virtuelle-maschinen/voraussetzungen/
[Test](/de/inhalte/fedora/virtuelle-maschinen/voraussetzungen/)
→ <a href="RELATIVEPATH">Test</a>
Similarly, using relref
in the context of HTML works fine, too:
<a href="{{< relref "voraussetzungen" >}}">Test</a>
→ <a href="RELATIVEPATH">Test</a>
I suspect the (one) argument is not properly passed to the relref
shortcode in the given (Markdown) context. But I don’t see why.
Additional information:
I’m not using a theme.
Environment:
❯ hugo env
hugo v0.121.2+extended linux/amd64 BuildDate=2024-02-07T00:00:00+00:00 VendorInfo=Fedora:0.121.2-1.fc40
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.22rc2"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2
Configuration:
baseURL = 'http://localhost:1313/'
languageCode = 'de-DE'
defaultContentLanguage = 'de'
defaultContentLanguageInSubdir = true
[languages]
[languages.de]
disabled = false
weight = 1
languageName = "Deutsch"
contentDir = "content/de"
languageCode = 'de-DE'
languageDirection = 'ltr'
[languages.en]
disabled = false
weight = 2
languageName = "English"
contentDir = "content/en"
languageCode = 'en-US'
languageDirection = 'ltr'
[taxonomies]
tag = "tags"
[frontmatter]
date = ["date", "publishDate", "lastmod"]
lastmod = ["lastmod"]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]
style = "onedark"
Does anyone have an idea what might be going on? Big thanks in advance!
Summary: Below you’ll find the solution. I used the different shortcode notation and the link works fine.
There was some confusion as to what directory structure to use, at least on my part. As far as I can tell, the initial structure that represents a Branch Bundle should be fine.