How can I set the baseurl for Jekyll via command line?

Viewed 1775

When I want to test something local I use

baseurl: "http://localhost/blog/_site"

and when I deploy the website I use

baseurl: "http://martinthoma.github.io"

Changing _config.yml every time is not a solution, because I would like to use a makefile like this:

Local testing:

make test

Deployment:

make deploy

So my question is: How can I set the baseurl for Jekyll via command line?

2 Answers

You can do this with the -b or --baseurl flag, as shown in the documentation here.

Related