From d3cda2bedcf59fd217c3d013f0d6aade5e917007 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 24 Dec 2020 21:05:59 -0300 Subject: Don't run linter on generated files --- _plugins/generate-feeds-for-categories.rb | 4 +++- _plugins/generate-pastebin-plaintext-alternate.rb | 3 ++- _plugins/linter.rb | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) (limited to '_plugins') diff --git a/_plugins/generate-feeds-for-categories.rb b/_plugins/generate-feeds-for-categories.rb index 9958fba..870f86f 100644 --- a/_plugins/generate-feeds-for-categories.rb +++ b/_plugins/generate-feeds-for-categories.rb @@ -66,7 +66,9 @@ module Jekyll class PageWithoutAFile < Jekyll::Page def read_yaml(*) - @data ||= {} + @data ||= { + "generated" => true + } end end end diff --git a/_plugins/generate-pastebin-plaintext-alternate.rb b/_plugins/generate-pastebin-plaintext-alternate.rb index 3b5fb9a..635252c 100644 --- a/_plugins/generate-pastebin-plaintext-alternate.rb +++ b/_plugins/generate-pastebin-plaintext-alternate.rb @@ -36,7 +36,8 @@ module Jekyll class PlaintextPageWithoutAFile < Jekyll::Page def read_yaml(*) @data ||= { - "plaintext" => "true" + "plaintext" => true, + "generated" => true } end end 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 -- cgit v1.2.3