Search code examples
githubgithub-pagesyew

Yew application unable to access static files when hosted in GitHub pages


I have this website I'm planning to host in GitHub pages. The URL for the home page contains the name of the repository https://s1n7ax.github.io/my-website/. Static files linked in the HTML is trying to access them in https://s1n7ax.github.io base but the base should be https://s1n7ax.github.io/my-website/. How to configure this in a way that works both local and GitHub pages?


Solution

  • Following adds the /my-website base to all the static file links.

    trunk serve --public-url /my-website