Experimental link checking workflow

Hey,
There has been quite some complains about broken links (and there is really a lot of them), so I started experimenting with a link checker to help overcome this side-effect of the docs migration.

I’ve tried a link-checker called “lychee” and that’s the workflow that worked for me so far.

Workflow

# 1) Install lychee with either
#   a) binary
cargo install lychee
#   b) container
podman pull docker.io/lycheeverse/lychee

# 2) cd to yours plugin dir
cd pulp_rpm

# 3) Check for legacy domain and fix them
grep -Re 'docs.pulpproject' staging_docs

# 4) Refresh the build case you make changes
pulp-docs build

# 5) Check with lychee with either
#   a) binary
lychee site/pulpcore --base site/ --offline
#   b) container
podman run -v "$(pwd):/home" -w /home lychee site/pulpcore --base site/ --offline

Tips

Link syntax: If you are running a local server, you only have to copy the path of the url and plug that into the template:

# path without root slash
[My Link](site:{{path}})

# example
[Pulpcore API](site:pulpcore/restapi/)

You can also check the markdown cheatsheet.

Notes

If you ran into any trouble with workflow, please report back here. I’ve not experimented extensively with this yet.

Also, I’ll eventually incorporate a link checker into pulp-docs, but I need to play with some of them anyway before doing that.

2 Likes