關於 Jekyll 的正式環境和測試環境
在正式機上建置時,自動使用 _config.yml
jekyll build
檔案 _config.yml 第一行加入
environment: production
在測試機建置時,指定使用 _config_dev.yml ( 這個檔案是自己建立 )
jekyll build --config _config_dev.yml
在測試機模擬時,指定使用 _config_dev.yml ( 這個檔案是自己建立 )
jekyll serve --watch --drafts --incremental --config _config_dev.yml
檔案 _config_dev.yml 第一行加入
environment: development
參考
How to build Jekyll project production with Windows command line
Your prod environment should run jekyll build which automatically uses _config.yml. Your dev environment should run jekyll
–config _config.yml,_config_dev.yml. In the Jekyll config docs, “Settings in later [config] files override settings in earlier files.” So, you can set the variable in prod and dev config files and use –config _config.yml,_config_dev.yml to set the variable in dev.
回上一頁