docs: add linkcheck

This commit is contained in:
zowoq 2024-06-01 08:22:31 +10:00
parent 3fcadaf275
commit ab99be2fa7
3 changed files with 23 additions and 1 deletions

View file

@ -23,5 +23,19 @@
cd $files
mkdocs build --strict --site-dir $out
'';
docs-linkcheck = pkgs.testers.lycheeLinkCheck rec {
extraConfig = {
exclude = [
"https://fonts.gstatic.com"
"https://monitoring.nix-community.org/alertmanager" # 401 behind auth
];
include_mail = true;
include_verbatim = true;
};
remap = {
"https://nix-community.org" = site;
};
site = config.packages.docs;
};
};
}

View file

@ -83,7 +83,7 @@
darwinConfigurations // devShells // { inherit (self') formatter; } // nixosConfigurations
// pkgs.lib.optionalAttrs (system == "x86_64-linux")
{
inherit (self'.packages) docs;
inherit (self'.packages) docs docs-linkcheck;
nixpkgs-update-supervisor-test = pkgs.callPackage ./hosts/build02/supervisor_test.nix { };
nixosTests-buildbot = pkgs.nixosTests.buildbot;
nixosTests-buildbot-nix-master = inputs'.buildbot-nix.checks.master;

View file

@ -108,6 +108,14 @@ def mkdocs(c: Any) -> None:
c.run("nix develop .#mkdocs -c mkdocs serve")
@task
def docs_linkcheck(c: Any) -> None:
"""
Run docs online linkchecker
"""
c.run("nix run .#docs-linkcheck.online")
def get_hosts(hosts: str) -> List[DeployHost]:
if hosts == "":
res = subprocess.run(