Module: Middleman::Presentation::PluginApi
- Defined in:
- lib/middleman-presentation-core/plugin_api.rb
Overview
Plugin Api
Class Method Summary collapse
-
.add_assets(component) ⇒ Object
Add assets which should be imported.
-
.add_component(component) ⇒ Object
Add frontend component.
-
.add_helpers(*m, &block) ⇒ Object
Add helpers.
Instance Method Summary collapse
-
#require_plugin(*names) ⇒ Object
Require some other plugin.
Class Method Details
.add_assets(component) ⇒ Object
Add assets which should be imported
def add_assets(path, output_paths: {}, importable_files: [], loadable_files: [], ignorable_files: [])
58 59 60 |
# File 'lib/middleman-presentation-core/plugin_api.rb', line 58 def add_assets(component) Middleman::Presentation.components_manager.add AssetComponent.new(**component) end |
.add_component(component) ⇒ Object
Add frontend component
32 33 34 |
# File 'lib/middleman-presentation-core/plugin_api.rb', line 32 def add_component(component) Middleman::Presentation.components_manager.add FrontendComponent.new(**component) end |
.add_helpers(*m, &block) ⇒ Object
Add helpers
add_helpers MyModule1, MyModule2
add_helpers do
def my_helper1
'my_helper1'
end
end
49 50 51 |
# File 'lib/middleman-presentation-core/plugin_api.rb', line 49 def add_helpers(*m, &block) Middleman::Presentation.helpers_manager.add(*m, &block) end |
Instance Method Details
#require_plugin(*names) ⇒ Object
Require some other plugin
24 25 26 |
# File 'lib/middleman-presentation-core/plugin_api.rb', line 24 def require_plugin(*names) application.plugins_manager.activate_plugin(names) end |