middleman / middleman-asciidoc

:beginner: AsciiDoc support for Middleman 4. (In Middleman 3, AsciiDoc support is provided by a core extension).
https://middlemanapp.com
Other
27 stars 12 forks source link

Don't execute extension logic in config mode #53

Closed mojavelinux closed 6 years ago

mojavelinux commented 6 years ago

When Middleman starts, it reads config.rb and runs all extensions two times. The first time through, it runs in config mode (app.mode? :config). The second time through it runs in either build or server mode (app.mode? :build or app.mode? :server, respectively). The config mode is intended to be used for registering cli flags. Since this extension doesn't currently contribute any cli flags, no processing is necessary in this mode. (In the future, if this extension does contribute cli flags, that logic would still be separate from normal processing).

In the constructor is called, return immediately in config mode. This will prevent the callbacks after_configuration and manipulate_resource_list from being called.