hexo-generator-api
Generate json api for your awesome hexo site
Installation
$ npm install hexo-generator-api --save
API Generation
List
A list of posts of the blog. Generated in public/api/list
. Lists are by default paginated. You can set the number of posts in a page via setting api_posts_per_page
.
The first list page will be generated to public/api/list/list.json
, the following pages will be generated to public/api/list/list-${pageNumber}.json
.
An example list page will be
Post
Every post will have a single JSON file to hold the result located in public/api/posts
.
An example post will be
For real world example, here are some of them:
Options
Set options in _config.yml
.
# Posts displayed per page in listapi_posts_per_page: 5
Contribute
Your contributions will be welcomed! Just :
- fork
- submit issue
- propose pull request
LICENSE
MIT