Reputation: 136207
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?
Upvotes: 7
Views: 2158
Reputation: 1984
You can do this with the -b
or --baseurl
flag, as shown in the documentation here.
Upvotes: 3
Reputation: 20554
I'd probably use a separate _config_prod.yml for production. When you build Jekyll, you can use the --config
flag and pass _config_prod.yml
to it as an option.
Check it out: https://jekyllrb.com/docs/configuration/#build-command-options
I imagine this would be easy enough to put into your makefile.
Upvotes: 8