我想知道是否可以同时运行多个 jekyll 应用程序。
我已经安装了 foreman,但是当另一个应用程序端口已经在运行时,它似乎无法更改应用程序端口。
目前我必须在 Procfile 中手动设置 jekyll 端口
web: jekyll --server 5000
无论如何可以自动执行此操作吗?
最佳答案
我想我有点晚了,但这里是那些有同样问题的人的答案。
与 Ruby on Rails 一样,命令 --port 3000
可以使用。
所以它看起来像这样:
$ jekyll serve --port 8888
编辑:如文档中所述,您也可以简单地添加选项
port: 8888
在您的 _config.yml
文件。新生成的文件如下所示:
name: Your New Jekyll Site
pygments: true
port: 8888
此处使用端口 8888 作为示例
进一步阅读:
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
所以使用命令行
jekyll serve --port 8888
相当于把
port: 8888
进入你的 _config.yml。
关于jekyll - 同时运行多个 jekyll 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14183051/