_includes/snippets/prepend-baseurl.html (4 lines of code) (raw):
{%- assign _include_path_replace_index = include.path | replace: 'index.html', '' -%}
{%- include snippets/prepend-path.html
path=_include_path_replace_index
prepend_path=site.baseurl -%}