Relative markdown links are not replaced by .html extension

Hello there! I’m simply trying to convert a directory of markdown files into HTML and while the build succeeds, all relative markdown links that point to other files, do not have the .html extension.

Using Hugo 0.16.

Here’s the repo for the site https://gitlab.com/axil/hugo/tree/gldocs and here’s a build where you can download the build artifacts and see for yourself https://gitlab.com/axil/hugo/builds/3833644. For example see the links inside public/README.html.

Is there maybe a setting I’m missing?

I have the same problem as well. Per documentation “SourceRelativeLinksEval” set to true should work, but it does not for markdown files. Here is a sample code that does not convert.

[About](about.md)

Github/gitlab does file with it.

Looked at the code, here it is

// Blackfriday holds configuration values for Blackfriday rendering.
type Blackfriday struct {
Smartypants bool
AngledQuotes bool
Fractions bool
HrefTargetBlank bool
SmartDashes bool
LatexDashes bool
TaskLists bool
PlainIDAnchors bool
SourceRelativeLinksEval bool
SourceRelativeLinksProjectFolder string
Extensions []string
ExtensionsMask []string
}

// NewBlackfriday creates a new Blackfriday filled with site config or some sane defaults.
func NewBlackfriday(c ConfigProvider) *Blackfriday {

defaultParam := map[string]interface{}{
	"smartypants":                      true,
	"angledQuotes":                     false,
	"fractions":                        true,
	"hrefTargetBlank":                  false,
	"smartDashes":                      true,
	"latexDashes":                      true,
	"plainIDAnchors":                   true,
	"taskLists":                        true,
	"sourceRelativeLinks":              false,
	"sourceRelativeLinksProjectFolder": "/docs/content",
}

Is it “sourceRelativeLinks” or “sourceRelativeLinksEval”? Neither works.
I am not an expert in golang to figure out from code really.

It’s not working in hugo preview or converting to html while generating page. The link stays as “about.md” in generated html.

Appreciate any help.

1 Like