{"id":18434719,"url":"https://github.com/assemble/assemble-indexer","last_synced_at":"2025-04-07T19:31:54.928Z","repository":{"id":57184954,"uuid":"42224918","full_name":"assemble/assemble-indexer","owner":"assemble","description":"Templates plugin to add index views to template collections.","archived":false,"fork":false,"pushed_at":"2015-12-18T17:10:37.000Z","size":32,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-23T00:05:04.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/assemble.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}},"created_at":"2015-09-10T05:50:48.000Z","updated_at":"2021-01-14T15:55:06.000Z","dependencies_parsed_at":"2022-09-14T09:01:22.029Z","dependency_job_id":null,"html_url":"https://github.com/assemble/assemble-indexer","commit_stats":null,"previous_names":["doowb/templates-indexer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-indexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-indexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-indexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-indexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/assemble","download_url":"https://codeload.github.com/assemble/assemble-indexer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247716357,"owners_count":20984226,"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":[],"created_at":"2024-11-06T06:05:04.776Z","updated_at":"2025-04-07T19:31:54.658Z","avatar_url":"https://github.com/assemble.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assemble-indexer [![NPM version](https://badge.fury.io/js/assemble-indexer.svg)](http://badge.fury.io/js/assemble-indexer)  [![Build Status](https://travis-ci.org/assemble/assemble-indexer.svg)](https://travis-ci.org/assemble/assemble-indexer)\n\n\u003e Assemble plugin to add index views to template collections.\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i assemble-indexer --save\n```\n\n## Usage\n\n```js\nvar indexer = require('assemble-indexer');\n```\n\n## API\n\n### [indexer](index.js#L29)\n\nAdd `addIndices` to a [templates](https://github.com/jonschlinkert/templates) collection that will add index views to the collection when given an array of pages.\n\n**Params**\n\n* `options` **{Object}**\n* `options.index` **{Object}**: Optional instance of `View` to use as the basis for the index views being added. Required if `createView` is not passed on plugin or method options.\n* `options.createView` **{Function}**: Function to create a view instance for the index view being added. Required if `index` is not passed on plugin or method options.\n* `returns` **{Function}**: Function to use as a plugin for [templates](https://github.com/jonschlinkert/templates)\n\n**Example**\n\n```\nvar archives = app.create('archives')\n  .use(indexer())\n  .addIndices(pages);\n```\n\n### .addIndices\n\n`addIndices` method decorated onto the given `collection` Iterators over a list of `pages` (built with `list.paginate`) and adds each page to the collection as a new index view\n\n**Params**\n\n* `pages` **{Array}**: Array of pages return from `list.paginate`\n* `opts` **{Object}**: Method options to override plugin options. Will also be added to locals for each index view.\n* `opts.index` **{Object}**: Optional instance of `View` to use as the basis for the index views being added. Required if `createView` is not passed on plugin or method options.\n* `opts.createView` **{Function}**: Function to create a view instance for the index view being added. Required if `index` is not passed on plugin or method options.\n* `returns` **{Object}**: Returns `collection` to enable chaining\n\n**Example**\n\n```js\ncollection.addIndices(pages, locals);\n```\n\n## Related projects\n\n* [assemble](https://www.npmjs.com/package/assemble): Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… [more](https://www.npmjs.com/package/assemble) | [homepage](http://assemble.io)\n* [paginationator](https://www.npmjs.com/package/paginationator): Paginate an array into pages of items. | [homepage](https://github.com/doowb/paginationator)\n* [template](https://www.npmjs.com/package/template): Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… [more](https://www.npmjs.com/package/template) | [homepage](https://github.com/jonschlinkert/template)\n* [templates](https://www.npmjs.com/package/templates): System for creating and managing template collections, and rendering templates with any node.js template engine.… [more](https://www.npmjs.com/package/templates) | [homepage](https://github.com/jonschlinkert/templates)\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d \u0026\u0026 npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/assemble/assemble-indexer/issues/new).\n\n## Author\n\n**Brian Woodward**\n\n+ [github/doowb](https://github.com/doowb)\n+ [twitter/doowb](http://twitter.com/doowb)\n\n## License\n\nCopyright © 2015 Brian Woodward\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 20, 2015._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemble%2Fassemble-indexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassemble%2Fassemble-indexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemble%2Fassemble-indexer/lists"}