Set the ASSET_URL to be relative to the 'theme/' url, which requires to use {{ SITEURL }}/{{ ASSET_URL }} in the template and make it works with both relative and absolute urls.