1
votes

I created a single-page static website which has been uploaded to GitHub Pages. I have come across the common problem related to GitHub Pages and relative links.

i.e. "assets/img/img.png" becomes "assets/css/assets/img/img.png"

I found some solutions which involved Jekyll and creating a base url in the _config.yml file.

Is there another solution which does not involve Jekyll?

2

2 Answers

1
votes

Use urls relative to root : /repoName/assets/img/img.png.

0
votes

The easiest way to serve static files on GitHub Pages without Jekyll is to create a file .nojekyll in the root of the repository. That will tell GitHub not to parse files as Jekyll.