Jekyll Asset Pipelineを使用して Web サイトを構築していますが、Web サイトを公開するときにのみ Web サイトを圧縮したいと考えています (約 20 秒かかります)。これを行うには、構成ファイルでこれらの値をプログラムで有効にする必要があります。
asset_pipeline:
bundle: false
compress: false
プラグインをコーディングしようとしましたが、機能しません。誰かが理由について私を助けることができますか?
module Jekyll
module Commands
# I overwrite this here so we only do heavy work (like compressing HTML and stuff)
# when we are building the site, not when testing (which uses jekyll serve)
class << Build
alias_method :_process, :process
def process(options)
require 'jekyll-press'
options['asset_pipeline']['bundle'] = true
options['asset_pipeline']['compress'] = true
_process(options)
end
end
end
end