From 3861844430a4a27b34f90b77b67382a9a2a8d83c Mon Sep 17 00:00:00 2001 From: Caley Woods Date: Wed, 15 May 2024 13:53:13 -0500 Subject: [PATCH] Add more context to the rubular link and remove unneeded slash in the regex --- _plugins/pa11y.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_plugins/pa11y.rb b/_plugins/pa11y.rb index 6b2272a57..3e4b6eb70 100644 --- a/_plugins/pa11y.rb +++ b/_plugins/pa11y.rb @@ -178,8 +178,10 @@ def parameterless_path(path) # @todo Is there a way to unnest this code? Jekyll hooks don't allow # early returns. Jekyll::Hooks.register :site, :post_render do |site| + # This rubular link shows an example of the generated regular expression + # and how it works against an imagined set of changed files # https://rubular.com/r/nfFL9P69KHSBoY - global_files = Regexp.new SITEWIDE_FOLDERS.map { |x| "\^#{x}" }.join("|") + global_files = Regexp.new SITEWIDE_FOLDERS.map { |x| "^#{x}" }.join("|") if DIFFER.changed_files.grep(global_files).any? File.open(PA11Y_TARGET_FILE, 'a') do |f| SiteSampler.new(site.config).pages.each do |path|