alexanderdavide / slidev-theme-academic

Academic presentations with Slidev made simple 🎓
https://slidev-theme-academic.alexeble.de
MIT License
109 stars 30 forks source link

Considering base url without trailing / for assets #19

Closed george-gca closed 10 months ago

george-gca commented 11 months ago

Fixes #14

alexanderdavide commented 10 months ago

Hey @george-gca,

thanks for opening this PR. Two things:

I'll push a change and would appreciate your help testing it.

george-gca commented 10 months ago

Since url can also be an external url, added support for this case. It seems to be working fine now.

alexanderdavide commented 10 months ago

I've now decided on following: local asset URLs are assumed to begin with a leading slash, if they don't, they are assumed to link externally. I refrained from adding logic to really detect external URLs because I assume there will be edge cases.

So, this PR only makes resolveAssetUrl safe for base URL with or without trailing slash.