jekyll - 同时运行多个 jekyll 应用程序

标签 jekyll foreman

我想知道是否可以同时运行多个 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 作为示例

进一步阅读:
  • 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
    


    所以使用命令行
    jekyll serve --port 8888
    

    相当于把 port: 8888进入你的 _config.yml。

    关于jekyll - 同时运行多个 jekyll 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14183051/

    相关文章:

    ruby-on-rails - 在工头任职期间是否有可靠的工具来单步执行代码

    ruby-on-rails - 为什么 heroku 不运行我的 procfile 进程?

    heroku - Heroku 会忽略 .env 文件吗?

    liquid - Jekyll/Liquid 标签列表

    javascript - 如何以与导入 map 相同的方式从 Mapbox 导入图例

    heroku - Heroku procfile“Procfile中未定义此类进程类型的网络”错误

    python - Django - Foreman 找不到已安装的模型

    html - Jekyll 页面没有更新

    html - 使用 Jekyll 的是真正的显示计数 View 页面吗?

    css - 如何在 css 文件中使用 Jekyll baseurl