From 2ec6f749abea62089fed395e9900c23ca487301b Mon Sep 17 00:00:00 2001 From: Yohei Yasukawa Date: Wed, 10 Sep 2025 14:15:02 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=A0=E3=83=86=E3=83=BC?= =?UTF-8?q?=E3=83=96=E3=83=AB=E9=87=8D=E8=A4=87=E6=A4=9C=E7=9F=A5=E3=82=92?= =?UTF-8?q?=E3=82=AB=E3=82=B9=E3=82=BF=E3=83=A0=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=AB=E7=A7=BB=E8=A1=8C=E3=81=97=E3=81=A6CI=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - HTMLファイル内のJavaScript検証コードを削除 - HTML Prooferのカスタムテストとして重複検知を実装 - 重複があれば CI (bundle exec rake test) でお知らせ 本番環境に手動で確認するテスト用 JavaScript コードを含めずに、 既存の CI/CD で自動的に実行および検証・確認できるようにしました。 --- _pages/time-table.html | 27 ----------------------- _tests/custom_checks.rb | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/_pages/time-table.html b/_pages/time-table.html index 85afbd4..23c2e82 100644 --- a/_pages/time-table.html +++ b/_pages/time-table.html @@ -119,31 +119,4 @@

- - diff --git a/_tests/custom_checks.rb b/_tests/custom_checks.rb index ff381ef..1fd7082 100644 --- a/_tests/custom_checks.rb +++ b/_tests/custom_checks.rb @@ -3,6 +3,7 @@ require 'json' require 'yaml' +require 'time' class CustomChecks < ::HTMLProofer::Check BASE_PATH = '_site' @@ -10,7 +11,9 @@ class CustomChecks < ::HTMLProofer::Check def run filename = @runner.current_filename puts "\tchecking ... " + filename.delete_prefix('_site') + check_directory_structure(filename) if filename.end_with?('.html') + check_time_table_overlaps if filename.end_with?('time-table/index.html') end # Check directory structure to ensure all pages are generated as index.html @@ -45,4 +48,48 @@ def is_redirect_file?(filename) content.include?(" e + add_failure("タイムテーブル検証エラー: #{e.message}") + end end