From 67d15838914e8cbf86c85b6d94bde8a5bc201e71 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 26 Dec 2020 08:07:29 -0300 Subject: linter.rb: Remove @@known_ids to allow live reloading to work --- _plugins/linter.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to '_plugins') diff --git a/_plugins/linter.rb b/_plugins/linter.rb index d0329cc..5281985 100644 --- a/_plugins/linter.rb +++ b/_plugins/linter.rb @@ -8,20 +8,19 @@ module Jekyll safe true priority :high - @@known_ids = Set[] - def insert_id(name, document) lang = document.data['lang'] ref = document.data['ref'] id = "#{name}:#{lang}:#{ref}" - if @@known_ids.include? id then + if @known_ids.include? id then raise "Duplicate ID found: '#{id}'" else - @@known_ids.add id + @known_ids.add id end end def assert_unique_ids(site) + @known_ids = Set[] site.collections.each do |name, collection| collection.docs.each do |document| unless document.data['generated'] then -- cgit v1.2.3