Sha256: 669526a49f899ddfcea7b31b6cd30b2c182597084197bc0821b0ce26f1861ced

Contents?: true

Size: 381 Bytes

Versions: 35

Compression:

Stored size: 381 Bytes

Contents

# frozen_string_literal: true

module Jekyll
  module Filters
    module Json
      # Converts an object to JSON
      #
      # Note: Jekyll 4 has a jsonify filter now.
      #
      # @param [Any]
      # @return [String]
      def json(object)
        require 'json'

        JSON.dump object
      end
    end
  end
end

Liquid::Template.register_filter(Jekyll::Filters::Json)

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
sutty-liquid-0.9.0 lib/jekyll/filters/json.rb
sutty-liquid-0.8.1 lib/jekyll/filters/json.rb
sutty-liquid-0.8.0 lib/jekyll/filters/json.rb
sutty-liquid-0.7.4 lib/jekyll/filters/json.rb
sutty-liquid-0.7.3 lib/jekyll/filters/json.rb
sutty-liquid-0.7.2 lib/jekyll/filters/json.rb
sutty-liquid-0.7.1 lib/jekyll/filters/json.rb
sutty-liquid-0.7.0 lib/jekyll/filters/json.rb
sutty-liquid-0.6.2 lib/jekyll/filters/json.rb
sutty-liquid-0.6.1 lib/jekyll/filters/json.rb
sutty-liquid-0.6.0 lib/jekyll/filters/json.rb
sutty-liquid-0.5.1 lib/jekyll/filters/json.rb
sutty-liquid-0.4.1 lib/jekyll/filters/json.rb
sutty-liquid-0.4.0 lib/jekyll/filters/json.rb
sutty-liquid-0.3.0 lib/jekyll/filters/json.rb