Skip to content

Pelican plugin to validate availability of referenced external links

License

Notifications You must be signed in to change notification settings

pelican-plugins/deadlinks

Repository files navigation

Dead Links: A Plugin for Pelican

Build Status PyPI Version Downloads License

This Pelican plugin scans links and check their status codes. For responses such as 403 or 404, the plugin adds a disabled class to the anchor, extends the anchor with a span label, and prints a warning to the console logger.

Installation

This plugin can be installed via:

python -m pip install pelican-deadlinks

As long as you have not explicitly added a PLUGINS setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add deadlinks to your existing PLUGINS list. For more information, please see the How to Use Plugins documentation.

Usage

To enable the dead link checker, set the DEADLINKS_VALIDATION option in your Pelican settings file to True. Alternatively, if you don’t want to validate links every time, you can selectively enable link validation at run-time via:

pelican content -e DEADLINKS_VALIDATION=true

Additionally, the following options can be changed:

DEADLINKS_OPTIONS = {
    "archive": True,
    "classes": ["custom-class1", "disabled"],
    "labels": True,
    "timeout_duration_ms": 1000,
    "timeout_is_error": False,
}

Options:

Name Description Default value
archive True/False. When enabled invalid links will be replaced with proper archive.org entry True
classes List of classes to be add to anchor element Empty list
labels Insert bootstrap's label after the anchor element False
timeout_duration_ms Time in ms after which request is considered as timed out 1000
timeout_is_error True/False. When enabled every time out is considered as dead link False

Contributing

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.

To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.

License

This project is licensed under the MIT license.

About

Pelican plugin to validate availability of referenced external links

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages