Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/straticjs/stratic-paginate-indexes
Gulp plugin to split Stratic index pages into pages
https://github.com/straticjs/stratic-paginate-indexes
gulp gulp-plugin hacktoberfest javascript stratic
Last synced: about 1 month ago
JSON representation
Gulp plugin to split Stratic index pages into pages
- Host: GitHub
- URL: https://github.com/straticjs/stratic-paginate-indexes
- Owner: straticjs
- License: lgpl-3.0
- Created: 2016-09-25T19:52:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-17T06:23:58.000Z (about 6 years ago)
- Last Synced: 2024-12-11T00:43:45.426Z (about 2 months ago)
- Topics: gulp, gulp-plugin, hacktoberfest, javascript, stratic
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# `stratic-paginate-indexes`
[Gulp][1] plugin to split [Stratic][2] index pages into pages
## Installation
npm install stratic-paginate-indexes
## Usage
Usage is quite simple. All you need to do is pipe Stratic indexes to this module and presto! You're done.
Minimal `gulpfile.js` for this module to work:
```js
var gulp = require('gulp');
var frontMatter = require('gulp-gray-matter');
var straticDateInPath = require('stratic-date-in-path');
var addsrc = require('gulp-add-src');
var straticPostsToIndex = require('stratic-posts-to-index');
var straticPaginateIndexes = require('stratic-paginate-indexes');gulp.task('post-index', function() {
gulp.src('*.md')
.pipe(frontMatter())
.pipe(straticDateInPath())
.pipe(addsrc('src/blog/index.jade'))
.pipe(straticPostsToIndex('index.jade'))
.pipe(straticPaginateIndexes());
});
```Complete example `gulpfile.js`:
```js
var gulp = require('gulp');
var frontMatter = require('gulp-gray-matter');
var remark = require('gulp-remark');
var remarkHtml = require('remark-html');
var straticDateInPath = require('stratic-date-in-path');
var addsrc = require('gulp-add-src');
var straticPostsToIndex = require('stratic-posts-to-index');
var straticPaginateIndexes = require('stratic-paginate-indexes');
var jade = require('gulp-jade');
var rename = require('gulp-rename');gulp.task('post-index', function() {
gulp.src('*.md')
.pipe(frontMatter())
.pipe(remark().use(remarkHtml))
.pipe(straticDateInPath())
.pipe(addsrc('src/blog/index.jade'))
.pipe(straticPostsToIndex('index.jade'))
.pipe(straticPaginateIndexes())
.pipe(jade({pretty: true, basedir: __dirname}))
.pipe(rename({ extname: '.html' }))
.pipe(gulp.dest('dist/blog'));
});
```## Locals
Two additional locals are provided to templates via the `file.data` attribute. `page` indicates which page number the file represents. `pageCount` represents how many total pages there are for that particular index.
## License
LGPL 3.0+
## Author
AJ Jordan
[1]: http://gulpjs.com/
[2]: https://github.com/straticjs/generator-stratic