A mkdocs plugin that excludes assets that are unused (orphaned) from being included in the final mkdocs output.
Project description
MKDocs Exclude Unused (orphaned) Files
A simple plugin for excluding files from being included in the mkdocs output if they are not referenced in other pages.
Instalation
Run pip install --upgrade mkdocs-exclude-unused-files
Configuration
Basic Configuration in the mkdocs.yml
file:
plugins:
- mkdocs_exclude_unused_files:
file_types_to_check: ["png", "jpg", "jpeg", "gif"]
This configuration will exclude all files from the final mkdocs output that have one of the configured file endings and are not referenced / linked to in other pages.
All Configuration Options
Setting | Default | Description |
---|---|---|
dry_run | False | Only print output into the command line and don't actually delete anything |
silent | False | Don't print out the found orphan files in the build process |
force_delete | False | By default the plugin only deletes files that are actually in the configured mkdocs output directory (site_dir). If you want to delete these files anyways due to your setup, enable this flag |
file_types_to_check | [ "png" , "jpg" , "jpeg" , "gif" , "pdf"] | Only check these file types for their usage and delete them if necessary. |
file_names_to_never_remove | ["favicon"] | Files with these names will never get deleted, even if no usage is detected. |
folders_to_never_remove_from | ["assets"] | Files in these folders will never get deleted, even if no usage is detected. Useful for always including specific static files. |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for mkdocs-exclude-unused-files-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | edf7bbe1b197195252d9fcc5670c31308c1868d624a01fe6270d96f9024e20e5 |
|
MD5 | 76db0b29c8c0088d4a5cf127a3274277 |
|
BLAKE2b-256 | fed09b99bdea6109b85d7cd2435124fad9e8a3d992e1f93c7de7e0357ca85c27 |
Close
Hashes for mkdocs_exclude_unused_files-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b302d7205cbff16ffa943d39c02c1f88dbe1c1af304585d049b5798f6c5a0b6c |
|
MD5 | 21fea15efa8adbe48c7b432e79af1b1c |
|
BLAKE2b-256 | b941c3c88dbdaa1479e00e44f047dbbb02e40b27e7397a64f1f63586119223a7 |