Added a little test to extract the links in the details property of a rule. Not part of the official test suite since it hits ghost.org a bunch.
Configured to run weekly
Can also be manually triggered
This is a very basic starting point that can be expanded as needed 😊
Things it does:
Ensure a tag has a link, and that link points to a WHATWG-compliant URL
Ensure a tag contains target="_blank"
Ensure links point to a ghost.org site
Ensure links are not redirected (non-fatal)
Ensure IDs referenced in a link are valid
self-rate-limits (5 URLs / 150ms right now)
Things it doesn't do:
Tell you where a link was redirected
Dedupe rule list - we could get away with only handling new rules of a test suite, but I didn't want to change existing files in this PR.
Things it could do in the future:
Only extract the list of URLs + IDs that are referenced
More validation checks
Test: https://ghost.org/docs/themes/helpers/pagination/ (71ms)
Test: https://ghost.org/docs/themes/helpers/meta_data/ (63ms)
Test: https://ghost.org/docs/themes/helpers/ghost_head_foot/ (153ms)
Test: https://ghost.org/docs/themes/helpers/img_url/ (179ms)
Test: https://ghost.org/docs/themes/contexts/ (200ms)
Test: https://ghost.org/docs/themes/contexts/author/ (74ms)
Test: https://ghost.org/docs/themes/helpers/site/ (156ms)
Test: https://ghost.org/docs/themes/contexts/post/ (79ms)
Test: https://ghost.org/docs/themes/helpers/config/ (55ms)
Test: https://ghost.org/docs/themes/contexts/tag/ (77ms)
Test: https://ghost.org/docs/themes/structure/ (75ms)
Test: https://ghost.org/docs/themes/helpers/foreach/ (62ms)
Test: https://ghost.org/docs/themes/helpers/ (74ms)
Test: https://ghost.org/docs/themes/contexts/index-context/ (56ms)
Test: https://ghost.org/docs/themes/helpers/asset/ (145ms)
Test: https://ghost.org/docs/themes/helpers/get/ (179ms)
Test: https://ghost.org/docs/themes//helpers/ (138ms)
Test: https://ghost.org/docs/themes/helpers/authors/ (173ms)
Test: https://ghost.org/docs/changes/ (58ms)
Test: https://ghost.org/docs/themes/helpers/tiers/ (57ms)
Test: https://ghost.org/docs/themes/helpers/price/ (56ms)
Test: https://ghost.org/docs/themes/content/ (410ms)
Test: https://ghost.org/docs/themes/members/ (226ms)
Test: https://ghost.org/docs/themes/helpers/labs/ (68ms)
Test: https://ghost.org/docs/themes/helpers/price (352ms)
https://ghost.org/docs/themes//helpers/ (used 4x) was redirected
https://ghost.org/docs/themes/helpers/price (used in canary/GS001-DEPR-CURR-SYM) was redirected
https://ghost.org/docs/themes/helpers/labs/ (used in v4/GS001-DEPR-LABS-MEMBERS) returned a not-ok (404) status.
5 rules have errors:
canary/GS010-PJ-PARSE
Has an href that is not part of the Ghost website
v1/GS010-PJ-PARSE
Has an href that is not part of the Ghost website
v2/GS010-PJ-PARSE
Has an href that is not part of the Ghost website
v3/GS010-PJ-PARSE
Has an href that is not part of the Ghost website
v4/GS010-PJ-PARSE
Has an href that is not part of the Ghost website
no issue
Added a little test to extract the links in the
details
property of a rule. Not part of the official test suite since it hitsghost.org
a bunch.This is a very basic starting point that can be expanded as needed 😊
Things it does:
a
tag has a link, and that link points to a WHATWG-compliant URLa
tag containstarget="_blank"
ghost.org
siteThings it doesn't do:
Things it could do in the future: