Skip to main content

Check links for Markdown-based site

Project description

Linkchecker for Markdown-based static generated sites

Actions Status

Python Requests-based simple check of links in Markdown .md files only. I got frustrated with all the false positives and moreso the false negatives from LinkChecker.py, which is also very slow and only works with HTML. This tool is very helpful for large Markdown-based Jekyll and Hugo sites. It is very fast and simple--it's what we use to check https://www.scivision.dev

Install

git clone https://github.com/scivision/linkchecker-markdown

pip install -e linkchecker-markdown

Usage

The static site generator does NOT have to be running for these tests--it looks at the .md files directly. Assuming your webpage Markdown files have top-level directory ~/web:

  • Jekyll

    python linkcheck.py ~/web/_posts
    
  • Hugo

    python linkcheck.py ~/web/content
    

The -v --verbose options prints the URLs as they are checked. Observe that URLs from different markdown files are interleaved, showing the asynchronous nature of this program.

Caveats

Strict anti-leeching methods cause false positives with this and other link checking programs. The solution may be to use an asyncio-based web browser interface like Arsenic in this program, or simply use Go-based htmltest.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for linkcheckmd, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size linkcheckmd-1.0.1.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page