Skip to content

Commit 70b10dc

Browse files
committed
Simplify installation of zola
1 parent e211b77 commit 70b10dc

File tree

8 files changed

+28
-19
lines changed

8 files changed

+28
-19
lines changed

.cargo/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
[alias]
22
blog = ["run", "--package", "generate_blog"]
3-
zola = ["run", "--manifest-path", "zola/Cargo.toml", "--"]

.github/workflows/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
31-
with:
32-
submodules: true
3331

3432
- run: rustup override set ${{ env.RUST_VERSION }}
3533
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
36-
with:
37-
workspaces: ".\nzola" # needed to cache build of zola in ./zola/target
34+
- name: Install Zola
35+
run: cargo install --locked --git https://github.com/getzola/zola --rev 45d3f8d6285f0b47013c5fa31eb405332118af8b
3836

3937
- run: cargo zola build
4038
- run: cp CNAME ./public/

.github/workflows/snapshot_tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ jobs:
1212
if: contains(github.event.pull_request.body, 'RUN_SNAPSHOT_TESTS')
1313
steps:
1414
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15-
with:
16-
submodules: true
1715
- run: rustup override set ${{ env.RUST_VERSION }}
1816
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
19-
with:
20-
workspaces: ".\nzola" # needed to cache build of zola in ./zola/target
17+
- name: Install Zola
18+
run: cargo install --locked --git https://github.com/getzola/zola --rev 45d3f8d6285f0b47013c5fa31eb405332118af8b
2119

2220
- run: git fetch --depth 2
2321
- run: git checkout origin/master

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "zola"]
2-
path = zola
3-
url = https://github.com/getzola/zola

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,28 @@ This is the blog of the Rust Programming Language.
66

77
It uses [Zola](https://www.getzola.org/) and is deployed to GitHub Pages via GitHub Actions.
88

9+
## Installing Zola
10+
11+
You need at least zola v0.21.0 to render the blog.
12+
13+
Compile from source:
14+
15+
```sh
16+
cargo install --locked --git https://github.com/getzola/zola --rev 45d3f8d6285f0b47013c5fa31eb405332118af8b
17+
```
18+
19+
You can also find a list of package managers that provide zola [here](https://www.getzola.org/documentation/getting-started/installation/).
20+
Prebuilt binaries are available for download [here](https://github.com/getzola/zola/releases/tag/v0.21.0).
21+
If you use [mise](https://mise.jdx.dev), you can run the pinned version of zola directly with `mise run zola`.
22+
923
## Building
1024

11-
To serve the site locally, first make sure the zola submodule is initialized:
25+
To serve the site locally, run the following:
1226

1327
```sh
14-
git submodule update --init --recursive
28+
zola serve --open
1529
```
1630

17-
Now run `cargo zola serve --open`.
18-
(The first run takes a while to compile Zola.)
1931
The site will be reloaded automatically when you make any changes.
2032

2133
## Contributing

crates/snapshot/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
fn snapshot() {
33
std::env::set_current_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/../..")).unwrap();
44
let _ = std::fs::remove_dir_all("public");
5-
let status = std::process::Command::new("cargo")
6-
.args(["zola", "build"])
5+
let status = std::process::Command::new("zola")
6+
.arg("build")
77
.status()
88
.unwrap();
99
assert!(status.success(), "failed to build site");

mise.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tasks]
2+
zola = "zola"
3+
serve = "zola serve --open"
4+
5+
[tools]
6+
zola = "0.21.0"

zola

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)