You've already forked hugo-extended
mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-09-13 06:25:32 -04:00
docs(readme): add usage
This commit is contained in:
50
README.md
50
README.md
@@ -1,3 +1,51 @@
|
||||
# hugo-bin [](https://travis-ci.org/fenneclab/hugo-bin)
|
||||
|
||||
Binary wrapper for [Hugo](https://github.com/spf13/hugo)
|
||||
> Binary wrapper for [Hugo](https://github.com/spf13/hugo)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install --save-dev hugo-bin
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### API
|
||||
|
||||
```js
|
||||
const execFile = require('child_process').execFile;
|
||||
const hugo = require('hugo-bin');
|
||||
|
||||
execFile(hugo, ['version'], (err, stdout) => {
|
||||
console.log(stdout);
|
||||
});
|
||||
```
|
||||
|
||||
### CLI
|
||||
|
||||
```sh
|
||||
$(npm bin)/hugo --help
|
||||
npm run create -- 'post/my-new-post' # see below 'npm-run-script'
|
||||
```
|
||||
|
||||
### npm-run-script
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"build": "hugo",
|
||||
"create": "hugo new",
|
||||
"serve": "hugo server -ws"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
See the [Hugo Documentation](http://gohugo.io) for more information.
|
||||
|
||||
## Super Inspired By
|
||||
|
||||
- [mastilver/apex-bin](https://github.com/mastilver/apex-bin)
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Shun Sato](http://blog.fenneclab.com)
|
||||
|
Reference in New Issue
Block a user