How do I get the base path?
You can use url() to generate a base url to any route in Drupal. You can supply the &lt;front&gt; route which, in effect, will be your base URL.

{{ url('&lt;front&gt;') }}


But, render it first if you're concatenating it:

{{ url('&lt;front&gt;')|render ~ file_url('public://image.jpg') }}


For example:

{{ url('&lt;front&gt;') ~ file_url('public://image.jpg') }}
# Outputs: "Array/sites/all/default/files/image.jpg"

{{ url('&lt;front&gt;')|render ~ file_url('public://image.jpg') }}
# Outputs: "http://example.com/sites/all/default/files/image.jpg"