Skip to content

Commit

Permalink
rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leleabhinav committed Sep 17, 2019
1 parent 5782de0 commit 27cd72b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/jekyll-optional-front-matter/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class Generator < Jekyll::Generator
safe true
priority :normal

CONFIG_KEY = "optional_front_matter".freeze
ENABLED_KEY = "enabled".freeze
CLEANUP_KEY = "remove_originals".freeze
CONFIG_KEY = "optional_front_matter"
ENABLED_KEY = "enabled"
CLEANUP_KEY = "remove_originals"

def initialize(site)
@site = site
Expand All @@ -18,6 +18,7 @@ def initialize(site)
def generate(site)
@site = site
return if disabled?

site.pages.concat(pages_to_add)
site.static_files -= static_files_to_remove if cleanup?
end
Expand Down Expand Up @@ -55,11 +56,13 @@ def page_from_static_file(static_file)
# Does the given Jekyll::Page match our filename blacklist?
def blacklisted?(page)
return false if whitelisted?(page)

FILENAME_BLACKLIST.include?(page.basename.upcase)
end

def whitelisted?(page)
return false unless site.config["include"].is_a? Array

entry_filter.included?(page.relative_path)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-optional-front-matter/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module JekyllOptionalFrontMatter
VERSION = "0.3.0".freeze
VERSION = "0.3.1"
end

0 comments on commit 27cd72b

Please sign in to comment.