You've already forked hugo-extended
mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-11-17 08:30:51 -05:00
add very simple types file, update readme
This commit is contained in:
37
README.md
37
README.md
@@ -14,17 +14,25 @@ yarn add hugo-extended --dev
|
|||||||
|
|
||||||
This package's version numbers align with Hugo's — `hugo-extended@0.64.1` installs Hugo v0.64.1, for example.
|
This package's version numbers align with Hugo's — `hugo-extended@0.64.1` installs Hugo v0.64.1, for example.
|
||||||
|
|
||||||
|
_Note:_ If you'll be using the SCSS features of Hugo Extended, it's probably smart to install [`postcss`](https://www.npmjs.com/package/postcss), [`postcss-cli`](https://www.npmjs.com/package/postcss-cli), and [`autoprefixer`](https://www.npmjs.com/package/autoprefixer) as devDependencies too, since they can be conveniently called via [built-in Hugo pipes](https://gohugo.io/hugo-pipes/postcss/):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install postcss postcss-cli autoprefixer --save-dev
|
||||||
|
# or...
|
||||||
|
yarn add postcss postcss-cli autoprefixer --dev
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The following examples simply refer to downloading and executing Hugo as a Node dependency. See the [official Hugo docs](https://gohugo.io/documentation/) for guidance on actual Hugo usage.
|
The following examples simply refer to downloading and executing Hugo as a Node dependency. See the [official Hugo docs](https://gohugo.io/documentation/) for guidance on actual Hugo usage.
|
||||||
|
|
||||||
### via CLI / `package.json`:
|
### via CLI / `package.json`:
|
||||||
|
|
||||||
If you'll be using the SCSS features of Hugo Extended, it's probably smart to install [`postcss`](https://www.npmjs.com/package/postcss), [`postcss-cli`](https://www.npmjs.com/package/postcss-cli), and [`autoprefixer`](https://www.npmjs.com/package/autoprefixer) as devDependencies too, since they can be called via [built-in Hugo pipes](https://gohugo.io/hugo-pipes/postcss/).
|
The `build:preview` script below is designed for [Netlify deploy previews](https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify/), where [`$DEPLOY_PRIME_URL`](https://docs.netlify.com/configure-builds/environment-variables/#deploy-urls-and-metadata) is substituted for the base URL (usually ending in .netlify.app) of each pull request, branch, or commit preview.
|
||||||
|
|
||||||
The `build:preview` script below is designed for [Netlify deploy previews](https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify/), where [`$DEPLOY_PRIME_URL`](https://docs.netlify.com/configure-builds/environment-variables/#deploy-urls-and-metadata) is substituted for the base URL (usually ending in netlify.app) of each commit or pull request.
|
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
|
// package.json:
|
||||||
|
|
||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -33,9 +41,9 @@ The `build:preview` script below is designed for [Netlify deploy previews](https
|
|||||||
"start": "hugo server"
|
"start": "hugo server"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^10.2.5",
|
"autoprefixer": "^10.3.4",
|
||||||
"hugo-extended": "^0.83.1",
|
"hugo-extended": "^0.88.1",
|
||||||
"postcss": "^8.2.9",
|
"postcss": "^8.3.6",
|
||||||
"postcss-cli": "^8.3.1"
|
"postcss-cli": "^8.3.1"
|
||||||
}
|
}
|
||||||
// ...
|
// ...
|
||||||
@@ -45,7 +53,8 @@ The `build:preview` script below is designed for [Netlify deploy previews](https
|
|||||||
```bash
|
```bash
|
||||||
$ npm run start
|
$ npm run start
|
||||||
|
|
||||||
Building sites …
|
Start building sites …
|
||||||
|
hugo v0.88.1-5BC54738+extended darwin/amd64 BuildDate=2021-09-04T09:39:19Z VendorInfo=gohugoio
|
||||||
|
|
||||||
| EN
|
| EN
|
||||||
-------------------+------
|
-------------------+------
|
||||||
@@ -59,6 +68,9 @@ Building sites …
|
|||||||
Cleaned | 0
|
Cleaned | 0
|
||||||
|
|
||||||
Built in 2361 ms
|
Built in 2361 ms
|
||||||
|
Watching for changes in {archetypes,assets,content,data,layouts,package.json,static}
|
||||||
|
Watching for config changes in config.toml
|
||||||
|
Environment: "development"
|
||||||
Serving pages from memory
|
Serving pages from memory
|
||||||
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
|
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
|
||||||
```
|
```
|
||||||
@@ -66,6 +78,8 @@ Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
|
|||||||
### via API:
|
### via API:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
// version.js:
|
||||||
|
|
||||||
import hugo from "hugo-extended";
|
import hugo from "hugo-extended";
|
||||||
import { execFile } from "child_process";
|
import { execFile } from "child_process";
|
||||||
|
|
||||||
@@ -74,12 +88,15 @@ execFile(hugo, ["version"], (error, stdout) => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ node version.js
|
||||||
|
hugo v0.88.1-5BC54738+extended darwin/amd64 BuildDate=2021-09-04T09:39:19Z VendorInfo=gohugoio
|
||||||
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- [jakejarvis/jarv.is](https://github.com/jakejarvis/jarv.is)
|
- [jakejarvis/jarv.is](https://github.com/jakejarvis/jarv.is)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Forked from [fenneclab/hugo-bin](https://github.com/fenneclab/hugo-bin) under the [MIT License](https://github.com/fenneclab/hugo-bin/blob/master/LICENSE), (c) [Shun Sato](http://blog.fenneclab.com/).
|
This project is distributed under the [MIT License](LICENSE.md). Hugo is distributed under the [Apache License 2.0](https://github.com/gohugoio/hugo/blob/master/LICENSE).
|
||||||
|
|
||||||
Hugo is distributed under the [Apache License 2.0](https://github.com/gohugoio/hugo/blob/master/LICENSE).
|
|
||||||
|
|||||||
7
index.d.ts
vendored
Normal file
7
index.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {string} Absolute path to the Hugo executable.
|
||||||
|
*/
|
||||||
|
declare const hugo: string;
|
||||||
|
export = hugo;
|
||||||
@@ -14,8 +14,9 @@
|
|||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"index.js",
|
"index.js",
|
||||||
|
"install.js",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"install.js"
|
"index.d.ts"
|
||||||
],
|
],
|
||||||
"bin": {
|
"bin": {
|
||||||
"hugo": "cli.js",
|
"hugo": "cli.js",
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": "./index.js",
|
"exports": "./index.js",
|
||||||
|
"types": "./index.d.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"decompress": "^4.2.1",
|
"decompress": "^4.2.1",
|
||||||
@@ -76,7 +78,8 @@
|
|||||||
"compat/compat": "off"
|
"compat/compat": "off"
|
||||||
},
|
},
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
"vendor/**"
|
"vendor/**",
|
||||||
|
"*.d.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user