使用特定的 Jekyll 環境構建

你可以在構建時設定 Jekyll 環境和值

JEKYLL_ENV=production jekyll b

JEKYLL_ENV=production jekyll build

JEKYLL_ENV=production bundle exec jekyll build

如果你的程式碼包含波紋管片段,則除非你的建築物使用 JEKYLL_ENV=production,否則不會包含 analytics.html

{% if jekyll.environment == "production" %}

   {% include analytics.html %}

{% endif %}