Sha256: cb5bc9afb6efc94675b8b0ca64380507edec0e503491e5fd310b8d0a231a0e09
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true require 'jekyll' require_relative 'old-data-reader' require_relative 'data-reader' module CloudCannonJekyll # Wraps read functions into one class class Reader attr_reader :site def initialize(site) @site = site end def read_data(dir = '_data') # DataReader doesn't exist in old versions of Jekyll if Jekyll::VERSION.start_with? '2.' CloudCannonJekyll::OldDataReader.new(@site).read(dir) else CloudCannonJekyll::DataReader.new(@site).read(dir) end end def read_drafts(dir = '') # PostReader doesn't exist in old versions of Jekyll if Jekyll::VERSION.start_with? '2.' @site.read_content(dir, '_drafts', Jekyll::Draft) else Jekyll::PostReader.new(@site).read_drafts(dir) end end def read_posts(dir = '') # PostReader doesn't exist in old versions of Jekyll if Jekyll::VERSION.start_with? '2.' @site.read_content(dir, '_posts', Jekyll::Post) else Jekyll::PostReader.new(@site).read_posts(dir) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems