How should I avoid the base url using markdownify "[google](www.google.com)"

I would like to be able to set a Site.Params value that is free text passed through markdownify that may or may not contain a url to an external site without prepending the base url:

config.toml:

baseurl = "https://mysite.com"

[params]
text = "This text should contain a link to [googles website](www.google.com)"

partial.html:

<div>
  <p>
    {{ with Site.Params.text }}{{ . | Markdownify}}
  </p>
</div>

The above gives a link to “http://localhost:1313/www.google.com” which i suppose would have my baseURL prepended if I deployed it.

How can I get the paragraph div to render “This text should contain a link to googles website” with a link to www.google.com

Use the full address like this: [googles website](https://www.google.com/)

2 Likes

Yep, as frjo points out, you’ve provided a relative URL. Adding the protocol should clear that up. :slight_smile: