# MkDocs Resize Images Plugin
<p align="center">
<a href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FJakubAndrysek%2Fmkdocs-resize-images&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=true"/></a>
<img src="https://img.shields.io/github/license/JakubAndrysek/mkdocs-resize-images?style=flat-square">
<img alt="PyPI" src="https://img.shields.io/pypi/v/mkdocs-resize-images?style=flat-square">
<img src="https://img.shields.io/github/stars/JakubAndrysek/mkdocs-resize-images?style=flat-square">
<img src="https://img.shields.io/github/forks/JakubAndrysek/mkdocs-resize-images?style=flat-square">
<img src="https://img.shields.io/github/issues/JakubAndrysek/mkdocs-resize-images?style=flat-square">
<img src="https://static.pepy.tech/personalized-badge/mkdocs-resize-images?period=month&units=international_system&left_color=black&right_color=orange&left_text=Downloads">
</p>
This MkDocs plugin finds all folders with a certain name, by default `assets-large`, resizes all images in those folders according to the plugin configuration.
Then saves the resized images in a different folder, by default `assets`.
The plugin also supports caching: if a file has not changed since the last time the plugin ran, it won't be processed again.
## Installation
Install the plugin using pip from [PyPI](https://pypi.org/project/mkdocs-resize-images/):
```bash
pip install mkdocs-resize-images
```
Activate the plugin in `mkdocs.yml`:
```yaml
plugins:
- search
- resize-images
```
Create `.gitignore` file in your project root directory and add the following line to it:
```bash
assets-large # or whatever you have set as source-dir
.resize-hash # if you have enabled caching
```
## Usage
By default, the plugin will look for images in all directories named assets-large, resize them to 800x600 pixels, and then save the resized images in assets directories in the same parent directories as the assets-large directories.
You can configure the plugin in your mkdocs.yml:
```yaml
plugins:
- search
- resize-images:
source-dir: assets-large
target-dir: assets
enable_cache: True
size: [800, 600]
extensions: ['.jpg', '.jpeg', '.png', '.gif', '.svg']
```
`source-dir`: The name of the directories to search for images to resize. Default is `assets-large`.
`target-dir`: The name of the directories to save the resized images in. Default is `assets`.
`size`: The size to resize the images to, specified as [width, height]. Default is `[800, 600]`.
`extensions`: List of image file extensions to consider for resizing. The plugin will look for images with these extensions in both lower and upper case. Default is `['.jpg', '.jpeg', '.png', '.gif', '.svg']`.
`enable_cache`: Whether to enable caching. If enabled, the plugin will check if a file has changed since the last time the plugin ran, and if not, it won't process the file again. Default is `True`.
Raw data
{
"_id": null,
"home_page": "https://github.com/JakubAndrysek/mkdocs-resize-images",
"name": "mkdocs-resize-images",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "mkdocs plugin,resize images,mkdocs,plugin,images,resize",
"author": "Jakub Andr\u00fdsek",
"author_email": "email@kubaandrysek.cz",
"download_url": "https://files.pythonhosted.org/packages/39/00/722ee67b10dbe27ddb0ace2fed4090e74f1a598f5322b3048f7d8f2f2df3/mkdocs-resize-images-1.0.1.tar.gz",
"platform": null,
"description": "# MkDocs Resize Images Plugin\n\n<p align=\"center\">\n<a href=\"https://hits.seeyoufarm.com\"><img src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FJakubAndrysek%2Fmkdocs-resize-images&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=true\"/></a>\n<img src=\"https://img.shields.io/github/license/JakubAndrysek/mkdocs-resize-images?style=flat-square\">\n<img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/mkdocs-resize-images?style=flat-square\">\n<img src=\"https://img.shields.io/github/stars/JakubAndrysek/mkdocs-resize-images?style=flat-square\">\n<img src=\"https://img.shields.io/github/forks/JakubAndrysek/mkdocs-resize-images?style=flat-square\">\n<img src=\"https://img.shields.io/github/issues/JakubAndrysek/mkdocs-resize-images?style=flat-square\">\n<img src=\"https://static.pepy.tech/personalized-badge/mkdocs-resize-images?period=month&units=international_system&left_color=black&right_color=orange&left_text=Downloads\">\n</p>\n\nThis MkDocs plugin finds all folders with a certain name, by default `assets-large`, resizes all images in those folders according to the plugin configuration.\nThen saves the resized images in a different folder, by default `assets`.\nThe plugin also supports caching: if a file has not changed since the last time the plugin ran, it won't be processed again.\n\n## Installation\n\nInstall the plugin using pip from [PyPI](https://pypi.org/project/mkdocs-resize-images/):\n\n```bash\npip install mkdocs-resize-images\n```\n\nActivate the plugin in `mkdocs.yml`:\n\n```yaml\nplugins:\n - search\n - resize-images\n```\n\nCreate `.gitignore` file in your project root directory and add the following line to it:\n\n```bash\nassets-large # or whatever you have set as source-dir\n\n.resize-hash # if you have enabled caching\n```\n\n\n## Usage\n\nBy default, the plugin will look for images in all directories named assets-large, resize them to 800x600 pixels, and then save the resized images in assets directories in the same parent directories as the assets-large directories.\n\nYou can configure the plugin in your mkdocs.yml:\n\n```yaml\nplugins:\n - search\n - resize-images:\n source-dir: assets-large\n target-dir: assets\n enable_cache: True\n size: [800, 600]\n extensions: ['.jpg', '.jpeg', '.png', '.gif', '.svg']\n```\n\n`source-dir`: The name of the directories to search for images to resize. Default is `assets-large`.\n\n`target-dir`: The name of the directories to save the resized images in. Default is `assets`.\n\n`size`: The size to resize the images to, specified as [width, height]. Default is `[800, 600]`.\n\n`extensions`: List of image file extensions to consider for resizing. The plugin will look for images with these extensions in both lower and upper case. Default is `['.jpg', '.jpeg', '.png', '.gif', '.svg']`.\n\n`enable_cache`: Whether to enable caching. If enabled, the plugin will check if a file has changed since the last time the plugin ran, and if not, it won't process the file again. Default is `True`.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "MkDocs plugin to resize images according to the configuration.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/JakubAndrysek/mkdocs-resize-images"
},
"split_keywords": [
"mkdocs plugin",
"resize images",
"mkdocs",
"plugin",
"images",
"resize"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7fd905d70cfe7a5aad92832c53d46686b625c4472a2993d83e15bc1f902981f8",
"md5": "98efaf37198b6eef301ae2d10fa2c52d",
"sha256": "caa55c9e82ec471b2490d9b7da7e5b8ac72ee08f8c1053f4ca7ba90052117dd5"
},
"downloads": -1,
"filename": "mkdocs_resize_images-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "98efaf37198b6eef301ae2d10fa2c52d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 5115,
"upload_time": "2023-06-30T16:20:43",
"upload_time_iso_8601": "2023-06-30T16:20:43.518930Z",
"url": "https://files.pythonhosted.org/packages/7f/d9/05d70cfe7a5aad92832c53d46686b625c4472a2993d83e15bc1f902981f8/mkdocs_resize_images-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3900722ee67b10dbe27ddb0ace2fed4090e74f1a598f5322b3048f7d8f2f2df3",
"md5": "3f84307b730a0157e72210828fd4933c",
"sha256": "2717d86dee4350fe65848ecc813e2767b2899e12e0442053ad53f6f5aa7d6925"
},
"downloads": -1,
"filename": "mkdocs-resize-images-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "3f84307b730a0157e72210828fd4933c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4585,
"upload_time": "2023-06-30T16:20:44",
"upload_time_iso_8601": "2023-06-30T16:20:44.902622Z",
"url": "https://files.pythonhosted.org/packages/39/00/722ee67b10dbe27ddb0ace2fed4090e74f1a598f5322b3048f7d8f2f2df3/mkdocs-resize-images-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-30 16:20:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JakubAndrysek",
"github_project": "mkdocs-resize-images",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "mkdocs-resize-images"
}