4
4
5
5
This is the blog of the Rust Programming Language.
6
6
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.
9
8
10
9
## Building
11
10
12
- To build the site locally:
11
+ To serve the site locally, first install Zola: (takes a couple minutes)
13
12
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 620bf3c46a39b41db30b1e91756a995bbff84d3a
18
16
```
19
17
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.
35
20
36
21
## Contributing
37
22
@@ -41,9 +26,7 @@ Like everything in Rust, the blog is licensed MIT/Apache 2.0. See the two
41
26
` LICENSE-* ` files for more details. We're also governed by the Rust
42
27
Code of Conduct, see ` CODE_OF_CONDUCT.md ` for more.
43
28
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
47
30
48
31
When writing a new blog post, keep in mind the file headers:
49
32
``` md
@@ -76,7 +59,7 @@ You can also run these tests locally for a faster feedback cycle:
76
59
```
77
60
Consider making a commit with these snapshots, so you can always check the diff of your changes with git:
78
61
``` sh
79
- git add --force src/snapshots # snapshots are ignored by default
62
+ git add --force snapshot/ src/snapshots # snapshots are ignored by default
80
63
git commit --message " WIP add good snapshots"
81
64
```
82
65
Since we can't merge the snapshots to main, don't forget to drop this commit when opening a pull request.
0 commit comments