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

build hugo-build

A wrapper around the hugo binary to proving building capabilities

42 releases (14 breaking)

new 0.129.0 Jul 17, 2024
0.128.0 Jun 25, 2024
0.124.1 Mar 20, 2024
0.121.1 Dec 8, 2023
0.116.0 Jul 31, 2023

#133 in Build Utils

Download history 4/week @ 2024-03-25 121/week @ 2024-04-01 396/week @ 2024-04-15 278/week @ 2024-04-22 254/week @ 2024-04-29 184/week @ 2024-05-06 266/week @ 2024-05-13 34/week @ 2024-05-20 353/week @ 2024-05-27 249/week @ 2024-06-03 21/week @ 2024-06-10 131/week @ 2024-06-24 429/week @ 2024-07-01 31/week @ 2024-07-08

594 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

~5–17MB
~268K SLoC