44
55This is the blog of the Rust Programming Language.
66
7- It's implemented as a small static site generator, that's deployed to GitHub
8- Pages via GitHub Actions.
7+ It uses [ Zola] ( https://www.getzola.org/ ) and is deployed to GitHub Pages via GitHub Actions.
98
109## Building
1110
12- To build the site locally:
11+ To serve the site locally, first install Zola: (takes a couple minutes)
1312
14- ``` console
15- $ git clone https://github.com/rust-lang/blog.rust-lang.org
16- $ cd blog.rust-lang.org
17- $ cargo run
13+ ``` 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 d3d4a93d552c2ad5d1d54bd923e4e181f3607ca2
1816```
1917
20- You could do it in release mode if you'd like, but it's pretty fast in debug.
21-
22- From there, the generated HTML will be in a ` public ` directory.
23- Open ` public/index.html ` in your web browser to view the site.
24-
25- ``` console
26- $ firefox public/index.html
27- ```
28-
29- You can also run a server, if you need to preview your changes on a different machine:
30-
31- ``` console
32- $ cargo run -p serve
33- Serving on: http://192.168.123.45:8000
34- ```
18+ Now run ` zola serve --open ` .
19+ The site will be reloaded automatically when you make any changes.
3520
3621## Contributing
3722
@@ -41,9 +26,7 @@ Like everything in Rust, the blog is licensed MIT/Apache 2.0. See the two
4126` LICENSE-* ` files for more details. We're also governed by the Rust
4227Code of Conduct, see ` CODE_OF_CONDUCT.md ` for more.
4328
44- Please send pull requests to the master branch. If you're trying to do
45- something big, please open an issue before working on it, so we can make sure
46- that it's something that will eventually be accepted.
29+ ### Writing a new blog post
4730
4831When writing a new blog post, keep in mind the file headers:
4932``` md
@@ -76,7 +59,7 @@ You can also run these tests locally for a faster feedback cycle:
7659 ```
7760 Consider making a commit with these snapshots, so you can always check the diff of your changes with git:
7861 ``` sh
79- git add --force src/snapshots # snapshots are ignored by default
62+ git add --force snapshot/ src/snapshots # snapshots are ignored by default
8063 git commit --message " WIP add good snapshots"
8164 ```
8265 Since we can't merge the snapshots to main, don't forget to drop this commit when opening a pull request.
0 commit comments