Sha256: ad0326c021335d8cf31e5ebc215216d695f8ba1beb9509cc26fc19382c9fd174

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

module Jekyll
  module Converters
    # Identify converter. Returns same content as given.
    # For more info on converters see https://jekyllrb.com/docs/plugins/converters/
    class Identity < Converter
      safe true

      priority :lowest

      # Public: Does the given extension match this converter's list of acceptable extensions?
      # Takes one argument: the file's extension (including the dot).
      #
      # ext - The String extension to check (not relevant here)
      #
      # Returns true since it always matches.
      def matches(_ext)
        true
      end

      # Public: The extension to be given to the output file (including the dot).
      #
      # ext - The String extension or original file.
      #
      # Returns The String output file extension.
      def output_ext(ext)
        ext
      end

      # Logic to do the content conversion.
      #
      # content - String content of file (without front matter).
      #
      # Returns a String of the converted content.
      def convert(content)
        content
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jekyll-4.0.1 lib/jekyll/converters/identity.rb
jekyll-4.0.0 lib/jekyll/converters/identity.rb
jekyll-4.0.0.pre.beta1 lib/jekyll/converters/identity.rb
jekyll-4.0.0.pre.alpha1 lib/jekyll/converters/identity.rb