Accessing base_url or other variables in markdown content?

I was trying to link images in markdown content, and with relative links it works when page is directly opened, but stops working when we click into any href #id links as it appends to the url of page (need ../ in path then)…

That’s kind of an unexpected behavior, can we access base_url of the page so we can link absolutely to a URL?

Also sometimes accessing current page variables like is useful, I didn’t found any docs pointing towards it unfortunately :frowning:

If you prefix your url with / as opposed to ../ you should have a path relative to the root url

Yeah, but base_url of the site contains a subpath already… Like https://something/subpath/<my-static-site>.

How’d I prepend subpath? I couldn’t read anything from config.toml

Did you find an answer to this? I’m having the same problem.

You can access it in shortcodes but not in the markdown content itself

Is there an example of such a shortcode? For example, what would the shortcode be for adding the subpath?

You can access the whole config object from a shortcode, including the base_url

shortcodes are the answer to this one and your other one about get_url base_url that i claimed couldnt be done in Markdown. In fact one can !

they have to be in the templates/shortcodes

just stumbled across it.