Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huntie/metalsmith-medium-data
Metalsmith plugin to fetch latest user post data from medium.com
https://github.com/huntie/metalsmith-medium-data
api medium metalsmith
Last synced: 16 days ago
JSON representation
Metalsmith plugin to fetch latest user post data from medium.com
- Host: GitHub
- URL: https://github.com/huntie/metalsmith-medium-data
- Owner: huntie
- License: mit
- Created: 2017-03-31T13:13:33.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2022-06-25T00:43:21.000Z (over 2 years ago)
- Last Synced: 2024-11-23T07:07:05.319Z (about 1 month ago)
- Topics: api, medium, metalsmith
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/metalsmith-medium-data
- Size: 158 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Metalsmith Medium data
Metalsmith plugin to fetch latest user post data from [medium.com](https://medium.com/) as metadata for template usage.
## Installation
$ npm install metalsmith-medium-data
## Usage
Add an `metalsmith-medium-data` entry in `metalsmith.json` or pass the plugin to `metalsmith.use()` in a JavaScript file.
**metalsmith.json**
```json
{
"plugins": {
"metalsmith-medium-data": {
"username": "huntie"
}
}
}
```**JavaScript file**
```js
import medium from 'metalsmith-medium-data';metalsmith.use(medium({
username: 'huntie'
});
```The plugin will add a new metadata object on build under the key `medium` for use in templates.
| Property | Type | Description |
| --- | --- | --- |
| `medium.user` | `Object` | The user profile data. |
| `medium.posts` | `Array` | The collection of most recent user posts. |## Options
| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `username` | `String` | Yes | `null` | The Medium account user from which to fetch posts. |
| `key` | `String` | No | `"medium"` | The name of the key to set in metadata. |
| `limit` | `Number` | No | `10` | The maximum number of `posts` to include. |## Contributing
If you discover a problem or have a feature request, please [create an issue](https://github.com/huntie/metalsmith-medium-data/issues) or feel free to fork this repository and make improvements.