Skip to content

Commit db52453

Browse files
authored
Don't follow web links by default (check, serve) (#22)
When running `nix run .#check` or `nix run .#serve`, don't linkcheck external links. The reason is that several of HashiCorp's resources that we link to serve 429s that are supposed to mean Too Many Requests, but they serve them 100% of the time to our linkchecker. Instead, run `nix run .#deepcheck` to follow web links. See #21.
1 parent c1ea26e commit db52453

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ enable = false
1919
[output.linkcheck]
2020
# Should we check links on the internet? Enabling this option adds a
2121
# non-negligible performance impact
22-
follow-web-links = true
22+
follow-web-links = false

flake.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@
5252
mdbook build
5353
'';
5454
};
55+
deepcheck.program = pkgs.writeShellApplication {
56+
name = "deepcheck";
57+
runtimeInputs = treefmtRuntimeInputs ++ mdbookRuntimeInputs;
58+
text = ''
59+
treefmt --no-cache --fail-on-change
60+
MDBOOK_OUTPUT__LINKCHECK__follow_web_links=true mdbook build
61+
'';
62+
};
5563
};
5664
formatter = pkgs.writeShellApplication {
5765
name = "treefmt";

0 commit comments

Comments
 (0)