#hugo #build #build-dependencies #building #binary #capabilities #proving

build hugo-build

A wrapper around the hugo binary to proving building capabilities

30 releases (10 breaking)

new 0.125.4 Apr 25, 2024
0.124.1 Mar 20, 2024
0.121.1 Dec 8, 2023
0.120.4 Nov 8, 2023
0.116.0 Jul 31, 2023

#140 in Build Utils

Download history 26/week @ 2024-01-03 4/week @ 2024-01-24 589/week @ 2024-02-21 489/week @ 2024-02-28 290/week @ 2024-03-06 233/week @ 2024-03-13 161/week @ 2024-03-20 50/week @ 2024-03-27 72/week @ 2024-04-03 82/week @ 2024-04-10 372/week @ 2024-04-17

578 downloads per month

Apache-2.0

8KB
129 lines

A wrapper around the hugo binary to proving building capabilities.

This crate downloads the hugo binaries on demand during build. So the first build needs connectivity to github.

The version number reflects the hugo version embedded.

Usage

Add the depenendy to your cargo.toml.

cargo add --build hugo-build

Add the following lines to you build.rs file. This will build a hugo page from the site directory and put the output into the target directory.

use std::path::Path;

fn main() {
    let base = std::env::var("CARGO_MANIFEST_DIR").unwrap();
    let sources = Path::new(&base).join("site");
    let destination = Path::new(&base).join("target").join("site");
    println!("cargo:rerun-if-changed={}",sources.display());
    hugo_build::init()
        .with_input(sources)
        .with_output(destination)
        .build()
        .unwrap();
}

Dependencies

~6–20MB
~293K SLoC