{"id":18434714,"url":"https://github.com/assemble/assemble-collections","last_synced_at":"2025-07-21T10:03:46.837Z","repository":{"id":16030873,"uuid":"18774640","full_name":"assemble/assemble-collections","owner":"assemble","description":"Node library to manage collections of objects in or out of Assemble.","archived":false,"fork":false,"pushed_at":"2016-04-20T19:37:14.000Z","size":58,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-03T01:38:24.364Z","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":"2014-04-14T20:02:04.000Z","updated_at":"2019-07-15T18:57:58.000Z","dependencies_parsed_at":"2022-08-31T01:22:37.825Z","dependency_job_id":null,"html_url":"https://github.com/assemble/assemble-collections","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/assemble/assemble-collections","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-collections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-collections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-collections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-collections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/assemble","download_url":"https://codeload.github.com/assemble/assemble-collections/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-collections/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266278319,"owners_count":23904039,"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:03.293Z","updated_at":"2025-07-21T10:03:46.811Z","avatar_url":"https://github.com/assemble.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assemble-collections [![NPM version](https://img.shields.io/npm/v/assemble-collections.svg)](https://www.npmjs.com/package/assemble-collections) [![Build Status](https://img.shields.io/travis/assemble/assemble-collections.svg)](https://travis-ci.org/assemble/assemble-collections)\n\n\u003e Assemble plugin to add middleware and helpers for working with frontmatter based collections.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install assemble-collections --save\n```\n\n**WARNING**\n\n\u003e This library has changed to be an assemble plugin as of version 0.2.0.\n\n## Usage\n\n```js\nvar collections = require('assemble-collections');\nvar app.use(collections());\n```\n\n## API\n\n### [.collections](index.js#L23)\n\nAdd middleware to gather collections from frontmatter and provide helpers for working with collections, collection groups, and views in collection groups.\n\n**Params**\n\n* `config` **{Object}**: Configuration object for setting up frontmatter collections.\n* `config.exts` **{Array}**: Array of extensions to use when adding `preRender` middleware. Defaults to `['md', 'hbs', 'html']`.\n* `config.collections` **{Object}**: Optional collections to look for in view frontmatter. Default collections are `categories` and `tags`.\n* `config.collections.${key}` **{Object}**: Individual collection configuration.\n* `config.collections.${key}.inflection` **{String}**: Singular version of collection key: e.g. `categories: { inflection: 'category' }`\n* `config.collections.${key}.sortOrder` **{String}**: Default sort direction of views in each collection. Defaults to `asc`.\n\n**Example**\n\n```js\napp.use(collections());\n```\n\n### [collections](index.js#L114)\n\nHelper to iterate or return an array of frontmatter collection keys.\n\n**Example**\n\n```handlebars\n{{! use as a block helper }}\n{{#collections}}\n  {{this.name}}\n{{/collections}}\n\n{{! use as a subexpression }}\n{{#each (collections)}}\n  {{this.name}}\n{{/each}}\n```\n\n### [collection](index.js#L153)\n\nHelper to return the collection instance or iterate over each collection item in the collection.\n\n**Example**\n\n```handlebars\n{{! use as a block helper }}\n{{#collection \"categories\"}}\n  \u003cspan\u003e{{category}}\u003c/span\u003e\n  \u003cul\u003e\n    {{#each items}}\n      \u003cli\u003e{{name}}\u003c/li\u003e\n    {{/each}}\n  \u003c/ul\u003e\n{{/collection}}\n\n{{! use as a subexpression }}\n{{#each (collection \"categories\")}}\n  \u003cspan\u003e{{category}}\u003c/span\u003e\n  \u003cul\u003e\n    {{#each items}}\n      \u003cli\u003e{{name}}\u003c/li\u003e\n    {{/each}}\n  \u003c/ul\u003e\n{{/each}}\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/assemble-collections/issues/new).\n\n## Building docs\n\nGenerate readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install verb \u0026\u0026 npm run docs\n```\n\nOr, if [verb](https://github.com/verbose/verb) is installed globally:\n\n```sh\n$ verb\n```\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\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\nverb © 2016, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT license](https://github.com/assemble/assemble-collections/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 20, 2016._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemble%2Fassemble-collections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassemble%2Fassemble-collections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemble%2Fassemble-collections/lists"}