From 25d432856093aecce66290b35e33903865fb0bb6 Mon Sep 17 00:00:00 2001 From: Caley Woods Date: Wed, 15 May 2024 16:05:35 -0500 Subject: [PATCH] Add file destination to the document --- _plugins/pa11y.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_plugins/pa11y.rb b/_plugins/pa11y.rb index 3e4b6eb70..1fc81a707 100644 --- a/_plugins/pa11y.rb +++ b/_plugins/pa11y.rb @@ -22,7 +22,7 @@ # @param differ [Object, #changed_files] The collaborator which lists # the files that were changed in the last commit. # @todo Are there cases when the document being checked has no layout? -Document = Struct.new(:path, :layout, :differ) do +Document = Struct.new(:path, :layout, :destination, :differ) do # @return [Boolean] Whether to scan this document in pa11y-ci def to_scan? source_changed? || layout_changed? @@ -81,12 +81,13 @@ def check_file_for_changes document = Document.new( file.relative_path, file.data["layout"], + file.destination(NO_ROOT_PATH), differ ) if document.to_scan? File.open(pa11y_target_file, 'a') { |f| - f.write(file.destination(NO_ROOT_PATH) + "\n") + f.write(document.destination + "\n") } end end