1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-04-26 09:05:20 -04:00

moved repository from hugo-node to hugo-extended

This commit is contained in:
Jake Jarvis 2020-02-01 18:57:00 -05:00
parent 9b1434b0b2
commit f6b20c2dee
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
3 changed files with 36 additions and 36 deletions

View File

@ -1,4 +1,4 @@
# hugo-extended via NPM [![CI status](https://github.com/jakejarvis/hugo-node/workflows/Run%20tests/badge.svg)](.github/workflows) [![npm](https://img.shields.io/npm/v/hugo-extended?color=red)](https://www.npmjs.com/package/hugo-extended) [![Hugo v0.63.2](https://img.shields.io/badge/Hugo-v0.63.2-orange)](https://github.com/gohugoio/hugo) [![Dependabot](https://api.dependabot.com/badges/status?host=github&repo=jakejarvis/hugo-node)](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 [![CI status](https://github.com/jakejarvis/hugo-extended/workflows/Run%20tests/badge.svg)](https://github.com/jakejarvis/hugo-extended/actions) [![npm](https://img.shields.io/npm/v/hugo-extended?color=red)](https://www.npmjs.com/package/hugo-extended) [![Hugo v0.63.2](https://img.shields.io/badge/Hugo-v0.63.2-orange)](https://github.com/gohugoio/hugo) [![Dependabot](https://api.dependabot.com/badges/status?host=github&repo=jakejarvis/hugo-extended)](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)

View File

@ -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);
}); });

View File

@ -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",