{"id":16461574,"url":"https://github.com/stringbean/hexo-image-toolkit","last_synced_at":"2025-08-11T00:35:03.978Z","repository":{"id":34240896,"uuid":"171542718","full_name":"stringbean/hexo-image-toolkit","owner":"stringbean","description":"Hexo plugin for generating responsive images with captions","archived":false,"fork":false,"pushed_at":"2023-12-31T14:41:01.000Z","size":889,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T06:18:21.197Z","etag":null,"topics":["hexo","hexo-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stringbean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-19T20:15:48.000Z","updated_at":"2022-06-12T17:04:10.000Z","dependencies_parsed_at":"2024-11-11T17:44:29.836Z","dependency_job_id":"39e75c38-cd32-4056-8fca-2c8c609f24ca","html_url":"https://github.com/stringbean/hexo-image-toolkit","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"31666e7f68d7f188f0505c1e9e111abd15a9591e"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Fhexo-image-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Fhexo-image-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Fhexo-image-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Fhexo-image-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stringbean","download_url":"https://codeload.github.com/stringbean/hexo-image-toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240988684,"owners_count":19889546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hexo","hexo-plugin"],"created_at":"2024-10-11T11:08:42.876Z","updated_at":"2025-02-27T06:24:04.082Z","avatar_url":"https://github.com/stringbean.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hexo Image Toolkit\n\n![npm (scoped)](https://img.shields.io/npm/v/@string-bean/hexo-image-toolkit)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/stringbean/hexo-image-toolkit/ci.yml?branch=main)\n![NPM](https://img.shields.io/npm/l/@string-bean/hexo-image-toolkit)\n\nHexo tag plugin for converting \u0026 resizing images and generating associated markup.\n\n## Install\n\nInstall the package:\n\n```shell\nnpm install -S @string-bean/hexo-image-toolkit\n```\n\nThen ensure that you have [asset folders](https://hexo.io/docs/asset-folders) enabled in your Hexo `_config.yml`:\n\n```yaml\npost_asset_folder: true\n```\n\n## Usage\n\nGiven the following Markdown with `example.jpg` having a size of 2048x1536 pixels:\n\n```markdown\n{% post_img example.jpg title=\"An example image\" retina %}\n```\n\nThe following HTML will be generated:\n\n```html\n\u003cfigure class=\"image\"\u003e\n  \u003cpicture\u003e\n    \u003csource\n      srcset=\"/post-path/example@2x.webp 2x, /post-path/example.webp\"\n      type=\"image/webp\"\n    /\u003e\n    \u003cimg\n      src=\"/post-path/example.jpg\"\n      alt=\"An example image\"\n      width=\"1024\"\n      height=\"768\"\n    /\u003e\n  \u003c/picture\u003e\n\n  \u003cfigcaption\u003e\n    \u003cspan\u003eAn example image\u003c/span\u003e\n  \u003c/figcaption\u003e\n\u003c/figure\u003e\n```\n\nAlong with the following image assets:\n\n- `/post-path/example@2x.webp` - sized 2048x1536\n- `/post-path/example.webp` - sized 1024x768\n- `/post-path/example.jpg` - sized 1024x768\n\n## Options\n\n| Name     | Default       | Description                                                                         |\n| -------- | ------------- | ----------------------------------------------------------------------------------- |\n| `title`  | _required_    | Title to use in the figure caption.                                                 |\n| `alt`    | _title value_ | Text to use for the `alt` tag. If not supplied then the `title` value will be used. |\n| `retina` | `false`       | If `true` then the                                                                  |\n| `width`  | _none (auto)_ | Fixed width to resize the image to.                                                 |\n| `height` | _none (auto)_ | Fixed height to resize the image to.                                                |\n\n### Image Sizing\n\nBy default, the size of the input image is used for both the WEBP and fallback images. If the `retina` flag is set then\nthis size will be used for the 2x image and fallback images generated at a quarter of the resolution.\n\nFor example, given an input image with a size of 2000x1000 pixels:\n\n| `retina` | `width` | `height` | 2x webp Size | Standard webp Size | Fallback Size | `img` Tag Size |\n| -------- | ------- | -------- | ------------ | ------------------ | ------------- | -------------- |\n| `false`  | unset   | unset    | _none_       | 2000x1000          | 2000x1000     | 2000x1000      |\n| `false`  | `400`   | unset    | _none_       | 400x200            | 400x200       | 400x200        |\n| `false`  | unset   | `2000`   | _none_       | 4000x2000          | 4000x2000     | 4000x2000      |\n| `false`  | `1500`  | `300`    | _none_       | 1500x300           | 1500x300      | 1500x300       |\n| `true`   | unset   | unset    | 2000x1000    | 1000x500           | 1000x500      | 1000x500       |\n| `true`   | `400`   | unset    | 400x200      | 200x100            | 200x100       | 200x100        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringbean%2Fhexo-image-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstringbean%2Fhexo-image-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringbean%2Fhexo-image-toolkit/lists"}