GRO-685-3 Remove jekyll/ruby - #1282
Conversation
| @@ -0,0 +1,159 @@ | |||
| // usage: bun script/check-broken-links.ts [output-file] | |||
There was a problem hiding this comment.
We were using htmlproofer for this, but that's ruby. This is a (mostly) vibe-coded replacement for it. It's suspiciously fast, but in my testing, it catches the same broken links that htmlproofer would, and the output can still be piped into script/analyze_links.clj (e.g. for .github/workflows/update-docs-base-bun.yml).
One difference is it doesn't check opengraph links:
// OpenGraph is intentionally NOT checked even though it was previously with
// htmlproofer. It was essentially an expensive no-op since OG images are
// served over cdn and external urls are skipped.
const CHECK_OPEN_GRAPH = false;
gantoreno
left a comment
There was a problem hiding this comment.
Approving to not block, just one minor item re: link checking. Nice work!
| const TAG_RE = | ||
| /<(?:a|link|img|script|iframe|source|track)\b[^>]*?\s(?:href|src)="([^"]*)"[^>]*>/gi; |
There was a problem hiding this comment.
Seems like this only targets double quoted attributes, but there are many occurrences of single-quoted links in the _site output which are probably getting skipped
| // Existence only depends on the path; fragments/query strings don't | ||
| // point at separate files. | ||
| const urlPath = rawUrl.split("#")[0].split("?")[0]; | ||
| if (!urlPath) continue; // pure fragment/query, e.g. href="#section" |
There was a problem hiding this comment.
One thing HTMLProofer did was fragment validation, fine to go if we're intentionally skipping this as a minimal replacement, but it's a parity difference worth knowing
There was a problem hiding this comment.
First of all great catch. But also, apparently script/analyze_links.clj has been ignoring hash errors. There are currently 27 internal hash errors, 28 if you count a regression I introduced that I just noticed because of this comment. The 28th is some markdown syntax I wasn't aware of:
## Conditional and Boolean logic operators {#conditional-operators}
used to set the ID, now it's just output as text. So it's definitely worth checking, but fixing the existing errors is maybe outside the scope of this stack.
TLDR Maybe I fix that one regression now and create a linear issue to add fragment validation + fix the remaining (existing) 27?
There was a problem hiding this comment.
Error 28 fixed in #1286
Linear issue for remaining 27 + adding functionality GRO-818: Validate hash fragments in broken link checker
There was a problem hiding this comment.
If this is now wrapping astro commands, and we can now go through Bun for that, do we need to keep this?
There was a problem hiding this comment.
Yeah I think we can remove it (done in 4632687). I don't think this script has worked for a while (maybe ever).
| - gem install bundler -v 2.5.22 | ||
| - bundle _2.5.22_ config set --local path 'vendor/bundle' | ||
| - bundle _2.5.22_ install | ||
| - sudo yum install -y rsync |
efcf7e1 to
3893dbd
Compare
GRO-685
PR env: https://gro-685-remove-jekyll.dkkh35gceu2po.amplifyapp.com/docs/latest/
Final removal of jekyll/ruby from docs repo.
All remaining jekyll/ruby code should be removed and anything that relied on it should use astro/bun.