Hey all!
Is there a way to reference static content (e.g. images) dynamically like you would in a template? i.e. using
{{ .Site.BaseURL }})
As far as I understand the default way is to just go for
img src=“assets/images/myimg.jpg”
This works just fine if the directory of the HTML-page never changes. In my case I worry 2 reasons for URL changes:
(1) moving from current uglyURLs to pretty ones
(2) going for the - hopefully released in 0.16 - multilang features which will move my page into e.g. en/page.html
If there’s no way it’s of course not the end of the world to fix these references if the page-directory ever changes.
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?