Bailey S
Bailey S

Reputation: 627

Jekyll remove Github user name and repo name from generated URLs

I am trying to deloy a Jekyll site using FTP to a web server using Github actions. Everytime I deploy it all of the URLs generated have "/PAGES/GITHUB-USERNAME/REPO-NAME/" injected in the middle of them and look like the following:

https://domain.tld/PAGES/GITHUB-USERNAME/REPO-NAME/assets/css/main.css

This is consequently breaking all of the CSS, Javascript and links between pages. All of the files generated are still in the correct places.

When I run the site locally, all of the links work as expected and look like the following:

http://127.0.0.1:4000/assets/css/main.css

Is there a way that I can get the URLs to look like:

https://domain.tld/assets/css/main.css

Thanks.

Upvotes: 0

Views: 162

Answers (1)

Bailey S
Bailey S

Reputation: 627

Huzzah! Managed to fix it.

In '_config.yml' you must specify a FQDN with the protocol as "url:" and for baseurl just leave empty since no baseurl is required.

I don't know if both of these are required because I added them at the same time.

url: 'https://sub.domain.tld'
baseurl: ''

Upvotes: 1

Related Questions