Validate content (e.g. check dead links)

I’m looking for a way to validate the content (and possibly also the theme) of my website. I tried htmlproofer, but that fails when I add a new post that I haven’t published yet.

How would you check your website for dead links etc. before publishing (e.g. in a build step)?

See the issue: