module Middleman::Renderers::Twig

Public Class Methods

included(app)
Alias for: registered
registered(app) click to toggle source
# File lib/middleman/renderers/twig.rb, line 9
def registered(app)
  app.before_configuration do
    template_extensions twig: :html
  end
  # Twig is not included in the default gems,
  # but we'll support it if available.

  # After config, setup mustache partial paths
  app.after_configuration do
    # Convert data object into a hash for twig
    sitemap.provides_metadata %r{\.twig$} do
      { :locals => { :data => data.to_h } }
    end
  end
end
Also aliased as: included