1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-04-26 04:25:21 -04:00

Update README

This commit is contained in:
Jake Jarvis 2021-03-31 11:29:24 -04:00
parent afe5c82c10
commit 08cc786d66
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
2 changed files with 20 additions and 7 deletions

View File

@ -16,16 +16,29 @@ This package's version numbers align with Hugo's — `hugo-extended@0.64.1` ins
## Usage
The following examples simply refer to executing Hugo as a local 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`:
```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 commit or pull request.
```jsonc
{
// ...
"scripts": {
"build": "hugo",
"start": "hugo server --buildDrafts --buildFuture --port 1313"
"build:preview": "hugo --baseURL \"${DEPLOY_PRIME_URL:-/}\" --buildDrafts --buildFuture",
"start": "hugo server"
},
"devDependencies": {
"autoprefixer": "^10.2.5",
"hugo-extended": "^0.75.1",
"postcss": "^8.2.9",
"postcss-cli": "^8.3.1"
}
// ...
}
```

View File

@ -9,16 +9,16 @@ const baseUrl = `https://github.com/gohugoio/hugo/releases/download/v${version}/
// Hugo Extended supports: macOS x64, macOS ARM64, Linux x64, Windows x64.
// all other combos fall back to vanilla Hugo.
/* eslint-disable indent, operator-linebreak, no-multi-spaces, unicorn/no-nested-ternary */
/* eslint-disable indent, operator-linebreak, unicorn/no-nested-ternary */
module.exports =
process.platform === 'darwin' && process.arch === 'x64'
? `${baseUrl}hugo_extended_${version}_macOS-64bit.tar.gz` :
process.platform === 'darwin' && process.arch === 'arm64'
? `${baseUrl}hugo_extended_${version}_macOS-ARM64.tar.gz` :
process.platform === 'win32' && process.arch === 'x64'
process.platform === 'win32' && process.arch === 'x64'
? `${baseUrl}hugo_extended_${version}_Windows-64bit.zip` :
process.platform === 'win32' && process.arch.endsWith('32')
process.platform === 'win32' && process.arch.endsWith('32')
? `${baseUrl}hugo_${version}_Windows-32bit.zip` :
process.platform === 'linux' && process.arch === 'x64'
@ -49,4 +49,4 @@ module.exports =
? `${baseUrl}hugo_${version}_OpenBSD-ARM64.tar.gz` :
null;
/* eslint-enable indent, operator-linebreak, no-multi-spaces, unicorn/no-nested-ternary */
/* eslint-enable indent, operator-linebreak, unicorn/no-nested-ternary */