hugo-extended
TypeScript icon, indicating that this package has built-in type declarations

0.139.0 • Public • Published

Hugo via NPM npm CI status

Plug-and-play binary wrapper for Hugo Extended, the awesomest static-site generator.

Installation

npm install hugo-extended --save-dev
# or...
yarn add hugo-extended --dev

hugo-extended defaults to the extended version of Hugo on supported platforms, and automatically falls back to vanilla Hugo if unsupported (mainly on 32-bit systems).

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, postcss-cli, and autoprefixer as devDependencies too, since they can be conveniently called via built-in Hugo pipes:

npm install postcss postcss-cli autoprefixer --save-dev
# or...
yarn add postcss postcss-cli autoprefixer --dev

Usage

The following examples simply refer to downloading and executing Hugo as a Node dependency. See the official Hugo docs for guidance on actual Hugo usage.

via CLI / package.json:

The build:preview script below is designed for Netlify deploy previews, where $DEPLOY_PRIME_URL is substituted for the base URL (usually ending in .netlify.app) of each pull request, branch, or commit preview.

// package.json:

{
  // ...
  "scripts": {
    "build": "hugo",
    "build:preview": "hugo --baseURL \"${DEPLOY_PRIME_URL:-/}\" --buildDrafts --buildFuture",
    "start": "hugo server"
  },
  "devDependencies": {
    "autoprefixer": "^10.3.4",
    "hugo-extended": "^0.88.1",
    "postcss": "^8.3.6",
    "postcss-cli": "^8.3.1"
  }
  // ...
}
$ npm run start

Start building sites …
hugo v0.88.1-5BC54738+extended darwin/amd64 BuildDate=2021-09-04T09:39:19Z VendorInfo=gohugoio

                   | EN
-------------------+------
  Pages            |  50
  Paginator pages  |   0
  Non-page files   | 138
  Static files     |  39
  Processed images |  63
  Aliases          |   0
  Sitemaps         |   1
  Cleaned          |   0

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
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)

via API:

// version.js:

import hugo from "hugo-extended";
import { execFile } from "child_process";

(async () => {
  const binPath = await hugo();

  execFile(binPath, ["version"], (error, stdout) => {
    console.log(stdout);
  });
})();
$ node version.js
hugo v0.88.1-5BC54738+extended darwin/amd64 BuildDate=2021-09-04T09:39:19Z VendorInfo=gohugoio

Examples

License

This project is distributed under the MIT License. Hugo is distributed under the Apache License 2.0.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.139.047,257latest

Version History

VersionDownloads (Last 7 Days)Published
0.139.047,257
0.138.028,954
0.137.15
0.137.019
0.136.5116
0.136.41
0.136.31
0.136.2125
0.136.1158
0.136.01
0.135.096
0.134.320
0.134.216
0.134.12
0.134.01
0.133.15
0.133.022
0.132.26
0.132.11
0.132.01
0.131.052
0.130.019
0.129.042
0.128.21
0.128.11
0.128.0105
0.127.015
0.126.336
0.126.227
0.126.110
0.126.01
0.125.743
0.125.63
0.125.51
0.125.4110
0.125.31
0.125.24
0.125.11
0.125.01
0.124.1112
0.124.01
0.123.8150
0.123.72
0.123.61
0.123.51
0.123.41
0.123.31
0.123.21
0.123.11
0.123.01
0.122.0351
0.121.216
0.121.14
0.121.01
0.120.4312
0.120.328
0.120.21
0.120.11
0.120.01
0.119.033
0.118.21
0.118.01
0.117.0398
0.116.11
0.116.01
0.115.4102
0.115.32
0.115.21
0.115.112
0.115.01
0.114.11
0.114.01
0.113.0370
0.112.71
0.112.61
0.112.51
0.112.41
0.112.3290
0.112.21
0.112.11
0.112.01
0.111.3326
0.111.21
0.111.11
0.111.01
0.110.0227
0.109.01
0.108.01
0.107.0209
0.106.028
0.105.01
0.104.3165
0.104.21
0.104.11
0.104.01
0.103.11
0.103.097
0.102.3140
0.102.21
0.102.11
0.102.01
0.101.0923
0.100.21
0.100.11
0.100.0111
0.99.13
0.99.01
0.98.01
0.97.320
0.97.21
0.97.11
0.97.02
0.96.06
0.95.01
0.94.21
0.94.11
0.94.01
0.93.31
0.93.25
0.93.11
0.93.01
0.92.2204
0.92.13
0.92.01
0.91.23
0.91.11
0.91.02
0.90.111
0.90.01
0.89.48
0.89.31
0.89.21
0.89.11
0.89.01
0.88.1-patch11
0.88.111
0.88.01
0.87.05
0.86.11
0.86.01
0.85.01
0.84.41
0.84.32
0.84.21
0.84.11
0.84.01
0.83.164
0.83.01
0.82.11
0.82.01
0.81.06
0.80.032
0.79.11
0.79.01
0.78.21
0.78.11
0.78.01
0.77.01
0.76.54
0.76.41
0.76.31
0.76.21
0.76.11
0.76.01
0.75.11
0.75.01
0.74.33
0.74.21
0.74.11
0.74.01
0.73.01
0.72.01
0.71.11
0.71.01
0.70.01
0.69.21
0.69.11
0.69.01
0.68.32
0.68.21
0.68.11
0.68.01
0.67.11
0.67.01
0.66.01
0.65.31
0.65.21
0.65.11
0.65.01
0.64.11
0.64.01
0.63.21

Package Sidebar

Install

npm i hugo-extended

Weekly Downloads

82,193

Version

0.139.0

License

MIT

Unpacked Size

13.4 kB

Total Files

9

Last publish

Collaborators

  • jakejarvis