From a29d72ee3a97210e194eb4dc3103fae6cb38a659 Mon Sep 17 00:00:00 2001 From: Josh Hadro Date: Fri, 27 Jan 2023 14:54:01 -0500 Subject: [PATCH 01/11] Update html-proofer to use 4.4.3 --- lib/tasks/test.rake | 60 +++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index 141470c..2db2354 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -1,52 +1,54 @@ require 'iiifc' namespace :test do - desc 'Check html' - task :html do - opts = { - check_html: true, - assume_extension: true, - validation: { - report_mismatched_tags: true, - report_invalid_tags: true - }, - checks_to_ignore: ['LinkCheck'] - } - HTMLProofer.check_directory(SITE_DIR, opts).run - end + # desc 'Check html' + # task :html do + # opts = { + # check_html: true, + # assume_extension: true, + # validation: { + # report_mismatched_tags: true, + # report_invalid_tags: true + # }, + # checks_to_ignore: ['LinkCheck'] + # } + # HTMLProofer.check_directory(SITE_DIR, opts).run + # end namespace :links do desc 'Check for internal link errors' task :internal do puts 'Checking for internal link errors' opts = { - checks_to_ignore: ['ImageCheck', 'HtmlCheck', 'ScriptCheck'], + checks: ['Links'], disable_external: true, - internal_domains: ['localhost:4000'] + enforce_https: false, + swap_urls: { %r{^http\://localhost\:4000} => 'https://iiif.io' }, } HTMLProofer.check_directory(SITE_DIR, opts).run end - desc 'Check for *iiif.io* link errors' - task :iiif do - puts 'Checking for link errors in *iiif.io* sites' - opts = { - checks_to_ignore: ['ImageCheck', 'HtmlCheck', 'ScriptCheck'], - url_ignore: [/^((?!iiif\.io).)*$/, 'github'] # temporarily ignore iiif.io github repo errors - } - HTMLProofer.check_directory(SITE_DIR, opts).run - end + # desc 'Check for *iiif.io* link errors' + # task :iiif do + # puts 'Checking for link errors in *iiif.io* sites' + # opts = { + # checks_to_ignore: ['ImageCheck', 'HtmlCheck', 'ScriptCheck'], + # url_ignore: [/^((?!iiif\.io).)*$/, 'github'] # temporarily ignore iiif.io github repo errors + # } + # HTMLProofer.check_directory(SITE_DIR, opts).run + # end desc 'Check for external link rot' task :external do puts 'Checking for external link errors' opts = { - external_only: true, - http_status_ignore: [429], - enforce_https: true, + enforce_https: false, + ignore_status_codes: [429], only_4xx: true, - checks_to_ignore: ['ImageCheck', 'HtmlCheck', 'ScriptCheck'], - url_ignore: [/.*iiif\.io.*/] + swap_urls: { %r{^http\://localhost\:4000} => 'https://iiif.io' }, + checks: ['Links','Images'], + ignore_urls: [/.*iiif\.io.*/], + ignore_files: [/.*news\/.*/] } HTMLProofer.check_directory(SITE_DIR, opts).run end From b5521e33576ea0ba112ab0800cdaad25873a49a2 Mon Sep 17 00:00:00 2001 From: Josh Hadro Date: Fri, 27 Jan 2023 14:54:19 -0500 Subject: [PATCH 02/11] Fix theme to not use empty anchor tag --- _includes/blocks/tabs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/blocks/tabs.html b/_includes/blocks/tabs.html index fa2feb7..09975fa 100644 --- a/_includes/blocks/tabs.html +++ b/_includes/blocks/tabs.html @@ -3,7 +3,7 @@ From 37d6c8cb4b22830cac1a0d451a002c3cb16d4cec Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 2 Feb 2023 14:51:38 +0000 Subject: [PATCH 03/11] Not including hero image if it is present but empty --- _includes/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/head.html b/_includes/head.html index 6e3d523..b808d13 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -24,7 +24,7 @@ {%- include misc/google-analytics.html -%} {%- endif -%} - {% if page.hero.image %} + {% if page.hero.image and page.hero.image != "" %} {% endif %} From e021af5b182d8bc0b9b9f8fcea2145ae719a7f4f Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 3 Feb 2023 00:30:30 +0000 Subject: [PATCH 04/11] Testing empty html test --- lib/tasks/test.rake | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index 2db2354..d1c22b6 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -1,19 +1,14 @@ require 'iiifc' namespace :test do - # desc 'Check html' - # task :html do - # opts = { - # check_html: true, - # assume_extension: true, - # validation: { - # report_mismatched_tags: true, - # report_invalid_tags: true - # }, - # checks_to_ignore: ['LinkCheck'] - # } - # HTMLProofer.check_directory(SITE_DIR, opts).run - # end + desc 'Check html' + task :html do + opts = { + check_html: true, + checks: [] + } + HTMLProofer.check_directory(SITE_DIR, opts).run + end namespace :links do desc 'Check for internal link errors' @@ -23,7 +18,7 @@ namespace :test do checks: ['Links'], disable_external: true, enforce_https: false, - swap_urls: { %r{^http\://localhost\:4000} => 'https://iiif.io' }, + internal_domains: ['localhost:4000'], } HTMLProofer.check_directory(SITE_DIR, opts).run end From c1ccebf6ccd945c4db4303c8f9516e1ae3d23d1f Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 3 Feb 2023 00:39:43 +0000 Subject: [PATCH 05/11] trying images test for html --- lib/tasks/test.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index d1c22b6..4bfdae4 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -5,7 +5,7 @@ namespace :test do task :html do opts = { check_html: true, - checks: [] + checks: ['Images'] } HTMLProofer.check_directory(SITE_DIR, opts).run end From a591cdbce7bc349a3d48f05255f4884bc1b87732 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 1 Mar 2023 12:58:39 +0000 Subject: [PATCH 06/11] Adding script check --- lib/tasks/test.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index 4bfdae4..eeb0d2b 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -41,7 +41,7 @@ namespace :test do ignore_status_codes: [429], only_4xx: true, swap_urls: { %r{^http\://localhost\:4000} => 'https://iiif.io' }, - checks: ['Links','Images'], + checks: ['Links','Images','Scripts'], ignore_urls: [/.*iiif\.io.*/], ignore_files: [/.*news\/.*/] } From b9b2e8082ed31d08522bfed5ac61acadc566f90e Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 1 Mar 2023 13:14:34 +0000 Subject: [PATCH 07/11] Trying to define the multiple tests --- lib/tasks/test.rake | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index eeb0d2b..ee95984 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -1,11 +1,10 @@ require 'iiifc' namespace :test do - desc 'Check html' + desc 'Check Images and Scripts' task :html do opts = { - check_html: true, - checks: ['Images'] + checks: ['Images', 'Scripts'] } HTMLProofer.check_directory(SITE_DIR, opts).run end @@ -17,32 +16,23 @@ namespace :test do opts = { checks: ['Links'], disable_external: true, - enforce_https: false, + enforce_https: true, internal_domains: ['localhost:4000'], } HTMLProofer.check_directory(SITE_DIR, opts).run end - # desc 'Check for *iiif.io* link errors' - # task :iiif do - # puts 'Checking for link errors in *iiif.io* sites' - # opts = { - # checks_to_ignore: ['ImageCheck', 'HtmlCheck', 'ScriptCheck'], - # url_ignore: [/^((?!iiif\.io).)*$/, 'github'] # temporarily ignore iiif.io github repo errors - # } - # HTMLProofer.check_directory(SITE_DIR, opts).run - # end desc 'Check for external link rot' task :external do puts 'Checking for external link errors' opts = { - enforce_https: false, + enforce_https: true, ignore_status_codes: [429], only_4xx: true, - swap_urls: { %r{^http\://localhost\:4000} => 'https://iiif.io' }, - checks: ['Links','Images','Scripts'], - ignore_urls: [/.*iiif\.io.*/], + #swap_urls: { %r{^http\://localhost\:4000} => 'https://iiif.io' }, + checks: ['Links','Images'], + url_ignore: [/.*iiif\.io.*/], ignore_files: [/.*news\/.*/] } HTMLProofer.check_directory(SITE_DIR, opts).run From c7386128595ab52730f9bfe8865143deddfd1f87 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 1 Mar 2023 13:19:54 +0000 Subject: [PATCH 08/11] Setting to https explicitly --- _layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index c5a9d1d..f5d7263 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -18,7 +18,7 @@ {%- include footer.html -%} - + From 3a0923d8f5b088cc1a8b4eaf632b1358028eab98 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 1 Mar 2023 13:46:40 +0000 Subject: [PATCH 09/11] Re-ordering tests --- lib/tasks/test.rake | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index ee95984..75e7170 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -16,7 +16,7 @@ namespace :test do opts = { checks: ['Links'], disable_external: true, - enforce_https: true, + enforce_https: false, internal_domains: ['localhost:4000'], } HTMLProofer.check_directory(SITE_DIR, opts).run @@ -27,10 +27,21 @@ namespace :test do task :external do puts 'Checking for external link errors' opts = { - enforce_https: true, + enforce_https: false, ignore_status_codes: [429], only_4xx: true, - #swap_urls: { %r{^http\://localhost\:4000} => 'https://iiif.io' }, + checks: ['Links','Images'], + url_ignore: [/.*iiif\.io.*/], + ignore_files: [/.*news\/.*/] + } + HTMLProofer.check_directory(SITE_DIR, opts).run + end + + desc 'Check for https link errors' + task :https do + puts 'Checking for https link errors' + opts = { + enforce_https: true, checks: ['Links','Images'], url_ignore: [/.*iiif\.io.*/], ignore_files: [/.*news\/.*/] From e43a4b952111b149d1c55ca947078f2c811e0482 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 2 Mar 2023 00:05:56 +0000 Subject: [PATCH 10/11] Adding https check to external check --- lib/tasks/test.rake | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index 75e7170..55f716a 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -27,7 +27,7 @@ namespace :test do task :external do puts 'Checking for external link errors' opts = { - enforce_https: false, + enforce_https: true, ignore_status_codes: [429], only_4xx: true, checks: ['Links','Images'], @@ -37,18 +37,6 @@ namespace :test do HTMLProofer.check_directory(SITE_DIR, opts).run end - desc 'Check for https link errors' - task :https do - puts 'Checking for https link errors' - opts = { - enforce_https: true, - checks: ['Links','Images'], - url_ignore: [/.*iiif\.io.*/], - ignore_files: [/.*news\/.*/] - } - HTMLProofer.check_directory(SITE_DIR, opts).run - end - desc 'Run rspec tests (if they exist)' task :spec do From a4db9d610b1ffb37c467cc41dea9dc89d5affcec Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 2 Mar 2023 00:11:05 +0000 Subject: [PATCH 11/11] Splitting out https check --- lib/tasks/test.rake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index 55f716a..8da90f8 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -27,7 +27,7 @@ namespace :test do task :external do puts 'Checking for external link errors' opts = { - enforce_https: true, + enforce_https: false, ignore_status_codes: [429], only_4xx: true, checks: ['Links','Images'], @@ -37,6 +37,16 @@ namespace :test do HTMLProofer.check_directory(SITE_DIR, opts).run end + desc 'Check for https link errors' + task :https do + puts 'Checking for https link errors' + opts = { + enforce_https: true, + checks: ['Links','Images'], + } + HTMLProofer.check_directory(SITE_DIR, opts).run + end + desc 'Run rspec tests (if they exist)' task :spec do