# eleventy-plugin-contributors

> An eleventy plugin to list git contributors for a page

Latest version **1.0.2** (published 2021-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install eleventy-plugin-contributors
pnpm add eleventy-plugin-contributors
yarn add eleventy-plugin-contributors
bun add eleventy-plugin-contributors
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-03-01 |
| First published | 2021-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | drffej |
| Maintainers | drffej |
| Keywords | eleventy, 11ty, plugin, contributors, git |

## Links

- npm: https://www.npmjs.com/package/eleventy-plugin-contributors
- Repository: https://github.com/drffej/eleventy-plugin-contributors
- Homepage: https://github.com/drffej/eleventy-plugin-contributors#readme
- Issues: https://github.com/drffej/eleventy-plugin-contributors/issues
- npm.io page: https://npm.io/package/eleventy-plugin-contributors

## Dependencies (1)

- [gitlog](https://npm.io/package/gitlog.md) ^4.0.4

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-03-01

## README

# Git Contributors for Eleventy

A git contributors plugin for [Eleventy](https://www.11ty.io/) static site generator.  The plugin returns a array of Git contributors for a page.

## Install the Plugin

Install in project directory by running:

```shell
npm install --savedev eleventy-plugin-contributors
```

In your Eleventy config file (defaults to `.eleventy.js`) include the plugin :

```js
const getContributors = require('eleventy-plugin-contributors');

module.exports = function(eleventyConfig) {
    eleventyConfig.addPlugin(getContributors);
}
```

### Configuration Options

The `contributor`plugin can be customised via the following options:

```js
const getContributors = require('eleventy-plugin-contributors');

module.exports = function(eleventyConfig) {
    eleventyConfig.addPlugin(contributors, {
        commits: 200, // the maxmium number of commits to include
        repo: __dirname // location of the repo
    });
}
```

## Using the Plugin

Now you can use the `getContributors` filter in your templates, to return an array of contributor records for a given file containing  the `git` settings for `authorName` and `authorEmail`.

For example the following Nujucks markup will list the contributors for the current page:

```html
{% set contributions = page.inputPath | getContributors -%}

{% for contributor in contributions -%}
-   {{contributor.authorName}} {{ contributor.authorEmail}}
{% endfor %}
```

## License

MIT.

---
_Source: https://npm.io/package/eleventy-plugin-contributors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
