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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dead Links

This plugin scans for links and checks status code of requested url. For responses such as 403 or 404, the plugin adds a "disabled" class to the anchor, extends anchor with a span label and dumps warning to the logger.

Requirements

BeautifulSoup4, requests

To install them using pip, type: pip install bs4 requests

Installation

Clone repository somewhere (let's assume destination is ./plugins/custom/deadlinks) and edit configuration file:

    PLUGINS_PATH = [
        # [...]
        'plugins/custom'
    ]
    PLUGINS = [
         # [...]
        'deadlinks'
    ]

Settings

To enable dead link checker, set the DEADLINK_VALIDATION option in your Pelican configuration file to True.

Additionally following options might be changed:

    DEADLINK_OPTS = {
        '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

About

Pelican plugin to validate availability of referenced external links

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages