Skip to content

Commit b3b14f1

Browse files
committed
Update readme with Zola workflow
1 parent 265ca48 commit b3b14f1

File tree

2 files changed

+25
-35
lines changed

2 files changed

+25
-35
lines changed

.gitignore

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
# generated by MacOS
12
.DS_Store
2-
/target/
3-
**/*.rs.bk
4-
site
5-
public
6-
static/styles/vendor.css
7-
static/styles/app.css
8-
static/styles/fonts.css
9-
static/styles/noscript.css
10-
src/snapshots
3+
4+
# cargo output
5+
/target
6+
7+
# zola output (site is deprecated, but people might still have them lying around)
8+
/site
9+
/public
10+
11+
# these are old compiled sass files, people might still have them lying arouynd
12+
/static/styles/vendor.css
13+
/static/styles/app.css
14+
/static/styles/fonts.css
15+
/static/styles/noscript.css
16+
17+
/snapshot/src/snapshots

README.md

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,19 @@
44

55
This 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 620bf3c46a39b41db30b1e91756a995bbff84d3a
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
4227
Code 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

4831
When 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

Comments
 (0)