Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running multiple jekyll app simultaneously

Tags:

jekyll

foreman

I was wondering if it is possible to run multiple jekyll app at the same time. I have installed foreman but it doesn't seem to be able to change the app port when an other one is already running.

At the moment I have to set the jekyll port manually in the Procfile

web: jekyll --server 5000

Is it in anyway possible to do this automatically?

like image 553
Yannick Schall Avatar asked Nov 29 '22 01:11

Yannick Schall


1 Answers

I think I am a bit late, but here is the answer for those, who have the same problem. Equally to Ruby on Rails the command --port 3000 can be used. So it would look like this:

$ jekyll serve --port 8888

Edit: As mentioned in the documentation you can also simply add the option port: 8888 in your _config.yml file.

The new generated file would look like this:

name: Your New Jekyll Site
pygments: true
port: 8888

Port 8888 is used here for the example

Further Reading:

  • Jekyll Configuration

These are just a few of the available configuration options. Many configuration options can either be specified as flags on the command line, or alternatively (and more commonly) they can be specified in a _config.yml file at the root of the source directory. Jekyll will automatically use the options from this file when run. For example, if you place the following lines in your _config.yml file:

source:      _source
destination: _deploy

Then the following two commands will be equivalent:

$ jekyll build
$ jekyll build --source _source --destination _deploy

So using the command line

jekyll serve --port 8888

is the equivalent to putting port: 8888 into your _config.yml.

like image 67
Nick Schmidt Avatar answered Dec 27 '22 09:12

Nick Schmidt