single assets folder can't work, relativize methods miss URLs in src="" content="" action=""
I've been struggling to make sense about how to cleanly handle having a single static assets folder in a multi-lingual site. Things like Javascript, the logo, form submission, etc. What makes this extra tricky is also being able to support the GitHub/GitLab Pages config, where there is an extra path element, e.g. https://untra.github.io/polyglot/. So what happens is that there is no clean way to have an assets folder that works in all these link locations, since some have the language path slug added, and others don't. The way it worked so far is just by copying the assets folder into the root and each language path subdir. That seems quite messy.
Here are some examples from f-droid.org / https://gitlab.com/fdroid/fdroid-website :
<meta name="msapplication-config" content="/assets/browserconfig.xml?v=8j6PKzW9Mk"/>
<script src="/js/sidebar-lang.js"></script>
<img src="/assets/fdroid-logo-text.svg" alt="F-Droid" />
<form action="/docs/" method="get">
Which comes from
<meta name="msapplication-config" content="{{ "/assets/browserconfig.xml?v=8j6PKzW9Mk" | prepend: site.baseurl }}"/>
<script src="{{site.baseurl}}/js/sidebar-lang.js"></script>
<img src="{{ site.baseurl }}/assets/fdroid-logo-text.svg" alt="{{ site.header-title }}" />
<form action="{{site.baseurl}}{{ page.url }}" method="get">
Right now, site.relativize_urls and site.relativize_absolute_urls just do a regexp across the whole rendered page, modifying all URLs in an href="". One thing that could help here is if those operations could somehow not happen for paths in exclude_from_localizations:.
test out v1.3.2 , let me know how that feels. I made some adjustments to your PR revisions, but I took them in them as intended for the most part. Let me know if 1.3.2 gets the job done.
Thanks for your contributions @eighthave !
This is working fine for me. I think this issue might be closed.