Skip to content

Site URl and Base URL

sachin soman edited this page Feb 4, 2021 · 2 revisions

It seems like there is lot of confusion regarding the configuration of the baseurl and url for our project. Currently we have the following configuration

baseurl: "/swift-megaminds-portfolio" 
url: ""
github_username: swift-megaminds

To understand what these two settings do look at how jekyll on github is served as shown below, in Jekyll serves the site with following configuration

Screenshot 2021-02-04 at 12 30 42

The reason why we leave the url in the config empty for now is that we will be serving the file through localhost. Therefor it automatically serves through http://127.0.0.1:PORT_NUMBER/

url: "" is equivalent to -> http://127.0.0.1:4000

Now the base_url will be the name of our project in our case it is swift-megaminds-portfolio Therefor when we do jekyll serve the site will be loaded on http://127.0.0.1:PORT_NUMBER/base_url ie in our case it will be.

http://127.0.0.1:4000/swift-megaminds-portfolio/

Thus when we link assets we need to follow this convention else the assests will be missing and will not render properly

Clone this wiki locally