diff --git a/.cargo/config.toml b/.cargo/config.toml index 3fe4469e5..a9b0b23cc 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,2 @@ [alias] blog = ["run", "--package", "generate_blog"] -zola = ["run", "--manifest-path", "zola/Cargo.toml", "--"] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 02aad2efe..a5a91610e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,15 +28,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - with: - submodules: true - run: rustup override set ${{ env.RUST_VERSION }} - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0 - with: - workspaces: ".\nzola" # needed to cache build of zola in ./zola/target + - name: Install Zola + run: cargo install --locked --git https://github.com/getzola/zola --rev 45d3f8d6285f0b47013c5fa31eb405332118af8b - - run: cargo zola build + - run: zola build - run: cp CNAME ./public/ - run: touch public/.nojekyll diff --git a/.github/workflows/snapshot_tests.yml b/.github/workflows/snapshot_tests.yml index 7cb5ca6e4..ee9308f4b 100644 --- a/.github/workflows/snapshot_tests.yml +++ b/.github/workflows/snapshot_tests.yml @@ -12,12 +12,10 @@ jobs: if: contains(github.event.pull_request.body, 'RUN_SNAPSHOT_TESTS') steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - with: - submodules: true - run: rustup override set ${{ env.RUST_VERSION }} - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0 - with: - workspaces: ".\nzola" # needed to cache build of zola in ./zola/target + - name: Install Zola + run: cargo install --locked --git https://github.com/getzola/zola --rev 45d3f8d6285f0b47013c5fa31eb405332118af8b - run: git fetch --depth 2 - run: git checkout origin/master diff --git a/.gitmodules b/.gitmodules index f538c9306..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "zola"] - path = zola - url = https://github.com/getzola/zola diff --git a/README.md b/README.md index 4977df4a7..7dc0c8281 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,28 @@ This is the blog of the Rust Programming Language. It uses [Zola](https://www.getzola.org/) and is deployed to GitHub Pages via GitHub Actions. +## Installing Zola + +You need at least zola v0.21.0 to render the blog. + +Compile from source: + +```sh +cargo install --debug --locked --git https://github.com/getzola/zola --rev 45d3f8d6285f0b47013c5fa31eb405332118af8b +``` + +You can also find a list of package managers that provide zola [here](https://www.getzola.org/documentation/getting-started/installation/). +Prebuilt binaries are available for download [here](https://github.com/getzola/zola/releases/tag/v0.21.0). +If you use [mise](https://mise.jdx.dev), you can run the pinned version of zola directly with `mise run zola`. + ## Building -To serve the site locally, first make sure the zola submodule is initialized: +To serve the site locally, run the following: ```sh -git submodule update --init --recursive +zola serve --fast --open ``` -Now run `cargo zola serve --open`. -(The first run takes a while to compile Zola.) The site will be reloaded automatically when you make any changes. ## Contributing diff --git a/crates/snapshot/src/lib.rs b/crates/snapshot/src/lib.rs index 1989a68e8..44a78be29 100644 --- a/crates/snapshot/src/lib.rs +++ b/crates/snapshot/src/lib.rs @@ -2,8 +2,8 @@ fn snapshot() { std::env::set_current_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/../..")).unwrap(); let _ = std::fs::remove_dir_all("public"); - let status = std::process::Command::new("cargo") - .args(["zola", "build"]) + let status = std::process::Command::new("zola") + .arg("build") .status() .unwrap(); assert!(status.success(), "failed to build site"); diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..5c1ae7b83 --- /dev/null +++ b/mise.toml @@ -0,0 +1,6 @@ +[tasks] +zola = "zola" +serve = "zola serve --fast --open" + +[tools] +zola = "0.21.0" diff --git a/zola b/zola deleted file mode 160000 index 45d3f8d62..000000000 --- a/zola +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 45d3f8d6285f0b47013c5fa31eb405332118af8b