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.12.3 lib/jekyll/filters/json.rb
sutty-liquid-0.12.2 lib/jekyll/filters/json.rb
sutty-liquid-0.12.1 lib/jekyll/filters/json.rb
sutty-liquid-0.12.0 lib/jekyll/filters/json.rb
sutty-liquid-0.12.0rc0 lib/jekyll/filters/json.rb
sutty-liquid-0.11.12 lib/jekyll/filters/json.rb
sutty-liquid-0.11.11 lib/jekyll/filters/json.rb
sutty-liquid-0.11.10 lib/jekyll/filters/json.rb
sutty-liquid-0.11.9 lib/jekyll/filters/json.rb
sutty-liquid-0.11.8 lib/jekyll/filters/json.rb
sutty-liquid-0.11.7 lib/jekyll/filters/json.rb
sutty-liquid-0.11.6 lib/jekyll/filters/json.rb
sutty-liquid-0.11.5 lib/jekyll/filters/json.rb
sutty-liquid-0.11.4 lib/jekyll/filters/json.rb
sutty-liquid-0.11.3 lib/jekyll/filters/json.rb
sutty-liquid-0.11.2 lib/jekyll/filters/json.rb
sutty-liquid-0.11.1 lib/jekyll/filters/json.rb
sutty-liquid-0.11.0 lib/jekyll/filters/json.rb
sutty-liquid-0.10.1 lib/jekyll/filters/json.rb
sutty-liquid-0.10.0 lib/jekyll/filters/json.rb