Can I reference BaseURL from content?

Perfect, Thanks a lot!

If anyone else wants to use this:
I created the file

layouts/shortcodes/baseurl.html

with the following content:

{{ .Page.Site.BaseURL }}

and can use it in the content as follows:

{{< baseurl >}}

which outputs (in local deployment):

http://localhost:1313/

I also think this is quite helpful if you want to reference static content from e.g. news articles which might end up in /year/month/day directory. It would save you the counting of “…/…/…/”.
Or is that another misunderstanding on my side?

Thanks again for the quick help =)
Omni

5 Likes