Get Jekyll Configuration Inside Plugin

后端 未结 3 905
陌清茗
陌清茗 2021-02-07 03:58

I\'d like to make changes to the Jekyll Only First Paragraph plugin to make the generation of a \'read more \' link a configurable option.

To do this I\'d need to be abl

3条回答
  •  忘掉有多难
    2021-02-07 04:32

    Jekyll.configuration({})['KEY_NAME'] will break the --config command line option because it will always load the configurations from the _config.yml file. Another bad side effect is that it will read the _config.yml file again.

    context.registers[:site].config['KEY_NAME'] is the correct answer because it will get the key from the configurations already loaded by Jekyll.

提交回复
热议问题