aboutsummaryrefslogtreecommitdiff
path: root/_plugins/linter.rb
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-12-24 21:05:59 -0300
committerEuAndreh <eu@euandre.org>2020-12-24 21:05:59 -0300
commitd3cda2bedcf59fd217c3d013f0d6aade5e917007 (patch)
tree492c50c63c4bf0745f39e72463e2348b634636d2 /_plugins/linter.rb
parentRename: _plugins/lint-hook.rb -> _plugins/linter.rb (diff)
downloadeuandre.org-d3cda2bedcf59fd217c3d013f0d6aade5e917007.tar.gz
euandre.org-d3cda2bedcf59fd217c3d013f0d6aade5e917007.tar.xz
Don't run linter on generated files
Diffstat (limited to '_plugins/linter.rb')
-rw-r--r--_plugins/linter.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/_plugins/linter.rb b/_plugins/linter.rb
index 634db80..ac1c6ed 100644
--- a/_plugins/linter.rb
+++ b/_plugins/linter.rb
@@ -23,13 +23,17 @@ module Jekyll
def assert_unique_ids(site)
site.collections.each do |name, collection|
collection.docs.each do |document|
- insert_id name, document
+ unless document.data['generated'] then
+ insert_id name, document
+ end
end
end
site.pages.each do |page|
unless IGNORED_PAGES.include? page.path
- insert_id 'page', page
+ unless page.data['generated'] then
+ insert_id 'page', page
+ end
end
end
end
@@ -147,13 +151,17 @@ module Jekyll
def assert_frontmatter(site)
site.collections.each do |name, collection|
collection.docs.each do |document|
- assert_frontmatter_fields site, name, document
+ unless document.data['generated']
+ assert_frontmatter_fields site, name, document
+ end
end
end
site.pages.each do |page|
unless IGNORED_PAGES.include? page.path
- assert_frontmatter_fields site, 'page', page
+ unless page.data['generated']
+ assert_frontmatter_fields site, 'page', page
+ end
end
end
end