mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-04-26 14:38:28 -04:00
moved repository from hugo-node to hugo-extended
This commit is contained in:
parent
9b1434b0b2
commit
f6b20c2dee
60
README.md
60
README.md
@ -1,4 +1,4 @@
|
|||||||
# hugo-extended via NPM [](.github/workflows) [](https://www.npmjs.com/package/hugo-extended) [](https://github.com/gohugoio/hugo) [](https://github.com/jakejarvis/hugo-node/pulls?q=is%3Apr+label%3Adependencies)
|
# <img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/hugo-logo-wide.svg?sanitize=true" alt="Hugo" width="115"> via NPM [](https://github.com/jakejarvis/hugo-extended/actions) [](https://www.npmjs.com/package/hugo-extended) [](https://github.com/gohugoio/hugo) [](https://github.com/jakejarvis/hugo-extended/pulls?q=is%3Apr+label%3Adependencies)
|
||||||
|
|
||||||
> Plug-and-play binary wrapper for [Hugo Extended](https://gohugo.io/), the awesomest static-site generator.
|
> Plug-and-play binary wrapper for [Hugo Extended](https://gohugo.io/), the awesomest static-site generator.
|
||||||
|
|
||||||
@ -14,6 +14,36 @@ yarn add hugo-extended --dev
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
See the [Hugo Documentation](https://gohugo.io/documentation/) for additional functionality.
|
||||||
|
|
||||||
|
### package.json
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"build": "hugo",
|
||||||
|
"start": "hugo serve",
|
||||||
|
"create": "hugo new"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### CLI:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$(npm bin)/hugo --help
|
||||||
|
npm run create -- post/my-new-post.md
|
||||||
|
```
|
||||||
|
|
||||||
|
or on Windows:
|
||||||
|
|
||||||
|
```bat
|
||||||
|
for /f "delims=" %F in ('npm bin') do call "%F\hugo" help
|
||||||
|
npm run create -- post/my-new-post.md
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@ -29,34 +59,6 @@ execFile(hugo, ['version'], (error, stdout) => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### package.json
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"scripts": {
|
|
||||||
"build": "hugo",
|
|
||||||
"start": "hugo serve",
|
|
||||||
"create": "hugo new"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### CLI
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$(npm bin)/hugo --help
|
|
||||||
npm run create -- post/my-new-post.md
|
|
||||||
```
|
|
||||||
|
|
||||||
or on Windows:
|
|
||||||
|
|
||||||
```bat
|
|
||||||
for /f "delims=" %F in ('npm bin') do call "%F\hugo" help
|
|
||||||
npm run create -- post/my-new-post.md
|
|
||||||
```
|
|
||||||
|
|
||||||
See the [Hugo Documentation](https://gohugo.io/documentation/) for additional functionality.
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- [jakejarvis/jarv.is](https://github.com/jakejarvis/jarv.is)
|
- [jakejarvis/jarv.is](https://github.com/jakejarvis/jarv.is)
|
||||||
|
@ -7,18 +7,16 @@ function getProjectRoot() {
|
|||||||
// `projectRoot` on postinstall could be INIT_CWD introduced in npm >= 5.4
|
// `projectRoot` on postinstall could be INIT_CWD introduced in npm >= 5.4
|
||||||
// see: https://github.com/npm/npm/issues/16990
|
// see: https://github.com/npm/npm/issues/16990
|
||||||
const initCwd = process.env.INIT_CWD;
|
const initCwd = process.env.INIT_CWD;
|
||||||
if (initCwd) {
|
if (initCwd)
|
||||||
return initCwd;
|
return initCwd;
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback of getting INIT_CWD
|
// Fallback of getting INIT_CWD
|
||||||
const cwd = process.cwd();
|
const cwd = process.cwd();
|
||||||
const paths = cwd.split(path.sep);
|
const paths = cwd.split(path.sep);
|
||||||
// If `process.cwd` ends with 'node_modules/*' then get the dependent root directory,
|
// If `process.cwd` ends with 'node_modules/*' then get the dependent root directory,
|
||||||
// otherwise return the `cwd` (ordinary it will be the postinstall process of hugo-bin itself).
|
// otherwise return the `cwd` (ordinary it will be the postinstall process of hugo-bin itself).
|
||||||
if (paths.length > 1 && paths[paths.length - 2] === 'node_modules') {
|
if (paths.length > 1 && paths[paths.length - 2] === 'node_modules')
|
||||||
return path.resolve('../../', cwd);
|
return path.resolve('../../', cwd);
|
||||||
}
|
|
||||||
|
|
||||||
return cwd;
|
return cwd;
|
||||||
}
|
}
|
||||||
@ -28,5 +26,5 @@ bin(getProjectRoot()).run(['version'])
|
|||||||
console.log('✔ Hugo installed successfully!');
|
console.log('✔ Hugo installed successfully!');
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error + '✖ ERROR: Hugo installation failed. :(');
|
console.error('✖ ERROR: Hugo installation failed. :(\n', error);
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "0.63.2",
|
"version": "0.63.2",
|
||||||
"hugoVersion": "0.63.2",
|
"hugoVersion": "0.63.2",
|
||||||
"description": "Plug-and-play binary wrapper for Hugo Extended, the awesomest static-site generator.",
|
"description": "Plug-and-play binary wrapper for Hugo Extended, the awesomest static-site generator.",
|
||||||
"homepage": "https://github.com/jakejarvis/hugo-node#readme",
|
"homepage": "https://github.com/jakejarvis/hugo-extended#readme",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Jake Jarvis",
|
"name": "Jake Jarvis",
|
||||||
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/jakejarvis/hugo-node.git"
|
"url": "git+https://github.com/jakejarvis/hugo-extended.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"hugo",
|
"hugo",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user