Sha256: 1b25dedc5b2ad0b59d2f39a655d6f34fa49a12e3d029e63055eb1fdec9882bca

Contents?: true

Size: 797 Bytes

Versions: 1

Compression:

Stored size: 797 Bytes

Contents

require 'middleman-core'
require 'middleman-somemoji/converter'

module Middleman
  module Somemoji
    class Extension < ::Middleman::Extension
      option :provider,     'apple',         %[Emoji provider (default is 'apple')]
      option :format,       'png',           %[Emoji format (default is 'png')]
      option :emoji_class,  'emoji',         %[<img> tag class (default is 'emoji')]
      option :emojis_dir,   '/images/emoji', %[Emoji images directory path (default is '/images/emoji')]

      def initialize(app, options_hash={}, &block)
        super

        require 'somemoji'

        @options = options

        app.before_render do |body, path, locs, template_class|
          ::Middleman::Somemoji::Converter.new(body, @options).convert
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
middleman-somemoji-0.1.0 lib/middleman-somemoji/extension.rb