Skip to content

Commit 55de40e

Browse files
authored
Switch to upstream Zola (#1632)
* Add Zola as submodule * Add cargo alias to run Zola in submodule * Switch to upstream Zola All of the patches we needed for the migration have been merged upstream (with some modifications, hence the `sort_by = "permalink"` diff). We use a submodule of Zola so we can better control the version of Zola that blog authors are running locally.
1 parent 0252bef commit 55de40e

File tree

9 files changed

+18
-11
lines changed

9 files changed

+18
-11
lines changed

.cargo/config.toml

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

.github/workflows/main.yml

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

3234
- run: rustup override set ${{ env.RUST_VERSION }}
3335
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
3436

35-
- name: Install Zola
36-
run: cargo install --locked --git https://github.com/senekor/zola --rev 79410eea82f837e4de9b1e4c3905287060b69255
37-
- run: zola build
37+
- run: cargo zola build
3838
- run: cp CNAME ./public/
3939
- run: touch public/.nojekyll
4040

.github/workflows/snapshot_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +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
1517
- run: rustup override set ${{ env.RUST_VERSION }}
1618
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
17-
- name: Install Zola
18-
run: cargo install --locked --git https://github.com/senekor/zola --rev 79410eea82f837e4de9b1e4c3905287060b69255
1919

2020
- run: git fetch --depth 2
2121
- run: git checkout origin/master

.gitmodules

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

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ It uses [Zola](https://www.getzola.org/) and is deployed to GitHub Pages via Git
88

99
## Building
1010

11-
To serve the site locally, first install Zola: (takes a couple minutes)
11+
To serve the site locally, first make sure the zola submodule is initialized:
1212

1313
```sh
14-
# using a fork because we rely on a few patches that haven't landed yet
15-
cargo install --locked --git https://github.com/senekor/zola --rev 79410eea82f837e4de9b1e4c3905287060b69255
14+
git submodule update --init --recursive
1615
```
1716

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

2121
## Contributing

content/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
+++
22
title = "Rust Blog"
33
description = "Empowering everyone to build reliable and efficient software."
4+
sort_by = "permalink"
45
generate_feeds = true
56
[extra]
67
index_title = "The Rust Programming Language Blog"

content/inside-rust/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
+++
22
title = "Inside Rust Blog"
33
description = "Want to follow along with Rust development? Curious how you might get involved? Take a look!"
4+
sort_by = "permalink"
45
generate_feeds = true
56
[extra]
67
index_title = 'The "Inside Rust" Blog'

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("zola")
6-
.arg("build")
5+
let status = std::process::Command::new("cargo")
6+
.args(["zola", "build"])
77
.status()
88
.unwrap();
99
assert!(status.success(), "failed to build site");

zola

Submodule zola added at 4cc4ded

0 commit comments

Comments
 (0)