summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/jekyll-4.4.1/lib/jekyll/converters/identity.rb
blob: 7579b330a06292beaf55037f986b67fe0ed15d01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true

module Jekyll
  module Converters
    # Identity 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