Hugo: BaseUrl not applied to src attributes of <img> tags generated in from markdown

Created on 18 Jan 2015  Â·  4Comments  Â·  Source: gohugoio/hugo

In config.yaml

baseurl: http://bguiz.github.io/js-standards

I expect hugo to translated markdown content:

![](/img/foo.png)

Into this html:

<img src="http://bguiz.github.io/js-standards/img/foo.png">

Or even this would work:

<img src="/js-standards/img/foo.png">

... but it does neither, and outputs this instead:

<img src="/img/foo.png">

How do I get image tags to take into account BaseUrl?

Duplicate

Most helpful comment

If you set canonifyurls to true in config, this should work.

The default value is false (which is opposite of what it says in the doc.)

All 4 comments

I should add that it makes no difference whether or not a trailing / is present in baseurl in config.yaml

If you set canonifyurls to true in config, this should work.

The default value is false (which is opposite of what it says in the doc.)

Thanks for the tip Bjørn - worked like a charm. The documentation
actually threw me off on this count!

W: http://bguiz.com

On 18 January 2015 at 10:57, Bjørn Erik Pedersen
[email protected] wrote:

If you set canonifyurls to true in config, this should work.

The default value is false (which is opposite of what it says in the doc.)

—
Reply to this email directly or view it on GitHub.

Good, close this as a duplicate of #802

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antifuchs picture antifuchs  Â·  3Comments

digitalcraftsman picture digitalcraftsman  Â·  3Comments

geddski picture geddski  Â·  3Comments

mumblecrunch picture mumblecrunch  Â·  3Comments

MunifTanjim picture MunifTanjim  Â·  3Comments