lib/cloudcannon-jekyll/generator.rb
# Add posts/drafts to collections config
Add posts/drafts to collections config
Add posts / drafts to collections config
def add_blogging_config(collections_config)
      collections_config["posts"] = { "output" => true } if Jekyll::VERSION.start_with? "2."
      drafts = @reader.read_drafts(collections_dir)
      if collections_config.key?("posts")
        collections_config["drafts"] = collections_config["posts"]&.dup || {}
      elsif drafts.any?
        collections_config["drafts"] = {}
      end
      folders = add_category_folder_config(collections_config, collections_config["posts"])
      folders.compact.each do |folder|
        drafts += @reader.read_drafts(folder)
      end
      drafts
    end
def add_blogging_config ( collections_config ) collections_config [ "posts" ] = { "output" => true } if Jekyll :: VERSION . start_with? "2." drafts = @reader . read_drafts ( collections_dir ) if collections_config . key? ( "posts" ) collections_config [ "drafts" ] = collections_config [ "posts" ] &. dup || { } elsif drafts . any? collections_config [ "drafts" ] = { } end folders = add_category_folder_config ( collections_config , collections_config [ "posts" ] ) folders . compact . each do | folder | drafts += @reader . read_drafts ( folder ) end drafts end
Add posts/drafts to collections config
Add posts / drafts to collections config
collections_config
<not_specific>