# Can I reference BaseURL from content?

**URL:** <https://discourse.gohugo.io/t/can-i-reference-baseurl-from-content/2686>\
**Category:** support\
**Created:** [February 12, 2016, 3:41pm UTC](https://discourse.gohugo.io/t/can-i-reference-baseurl-from-content/2686 "2016-02-12T15:41:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Omni](https://avatars.discourse-cdn.com/v4/letter/o/779978/32.png) [@Omni](https://discourse.gohugo.io/u/Omni)\
**Post date:** [February 12, 2016, 3:59pm UTC](https://discourse.gohugo.io/t/can-i-reference-baseurl-from-content/2686/3 "2016-02-12T15:59:08Z")

</div>

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/](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

---

_[View the full topic](https://discourse.gohugo.io/t/can-i-reference-baseurl-from-content/2686)._
