CleanGhostImages-0.3.0
توضیحات
A tool to find unused images in the Ghost blog content directory
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | CleanGhostImages-0.3.0 |
| نام | CleanGhostImages |
| نسخه کتابخانه | 0.3.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Ixonae |
| ایمیل نویسنده | contact@ixonae.com |
| آدرس صفحه اصلی | https://github.com/ixonae/CleanGhostImages |
| آدرس اینترنتی | https://pypi.org/project/CleanGhostImages/ |
| مجوز | GNU GENERAL PUBLIC LICENSE v2 |
# CleanGhostImages
The Ghost blogging platform only has a naive images system management system. Images that you upload when writing a blog
post but end-up not using are stored ad vitam aeternam without a quick way to remove them.
This package helps to find images that are not used by your blog but are still stored in your images directory, and to
delete them.
The script works by parsing a Ghost json export file, finding references to images, and comparing it with the content
of the Ghost images directory.
The script works on the assumption that this is a standard installation and that the images are in the `content/images`
directory of your Ghost installation.
This was tested with Ghost 5.39.0, and comes with no warranty. Make sure to have a backup before you remove anything.
## Usage
The code requires you to export your website in Json from the administration panel / "Export your content".
You can then use `python -m cleanghostimages` with the following options:
- `--json-export-file` (required): The path to your json export file. Note that you don't need to upload it from your
server because it will be stored in the `content/data` folder of your ghost installation
- `--ghost-dir` (required): The path to your Ghost instance (e.g. `/opt/ghost/`)
- `--print-unused-images` prints the list of all the images that are present in your content directory but not used
in the Ghost json export
- `--print-missing-images` prints the list of all the images that are listed in your Ghost json export but are not in
the images directory
- `--statistics` prints some information about the number of images found vs used/missing
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl CleanGhostImages-0.3.0:
pip install CleanGhostImages-0.3.0.whl
نصب پکیج tar.gz CleanGhostImages-0.3.0:
pip install CleanGhostImages-0.3.0.tar.gz