Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clemsos/metalsmith-scan-images
A metalsmith plugin that scan all images in subfolders and add it to metadata.
https://github.com/clemsos/metalsmith-scan-images
Last synced: 2 months ago
JSON representation
A metalsmith plugin that scan all images in subfolders and add it to metadata.
- Host: GitHub
- URL: https://github.com/clemsos/metalsmith-scan-images
- Owner: clemsos
- Created: 2015-06-29T14:05:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-02T06:53:21.000Z (over 9 years ago)
- Last Synced: 2024-10-06T20:34:34.509Z (3 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Metalsmith Scan Images
A metalsmith plugin to easily create image galleries.
This plugin will scan all images included in folders following a pattern (ex ```'content/projects/**/*.md'```) and add an array of paths called ```images``` to each post metadata.
Supported extensions : ```"jpg", "svg", "png", "gif", "JPG", "SVG", "PNG", "GIF"```
## Install
```sh
npm install --save metalsmith-scan-images
```## API
```js
var Metalsmith = require('metalsmith');
var images = require("metalsmith-scan-images");var metalsmith = new Metalsmith(__dirname)
.use(images( 'content/**/**/index.html' ))
```
## Use itA basic example of template for an image gallery
```html
{{#each images }}
{{/each}}
```