|
1 | 1 | mruby.org |
2 | 2 | ========= |
3 | 3 |
|
4 | | -This is the [Jekyll](https://jekyllrb.com/) source of |
5 | | -the [mruby.org](https://mruby.org/) website. |
| 4 | +This is the [Jekyll](https://jekyllrb.com/) source of the [mruby.org](https://mruby.org/) website. |
6 | 5 |
|
7 | | -## Preview |
| 6 | +## Prerequisites |
8 | 7 |
|
9 | | -The following will give you a preview of the site. |
| 8 | +- **Ruby** — version is specified in `.ruby-version` |
| 9 | +- **Bundler** — `gem install bundler` |
| 10 | +- **`gh` CLI** — required by `gen:mrbdoc` and `gen:releasedata` to query the GitHub API |
10 | 11 |
|
11 | | -Install bundler: |
| 12 | +## Local development |
12 | 13 |
|
13 | 14 | ```shell |
14 | | -gem install bundler |
| 15 | +git clone https://github.com/mruby/mruby.github.io |
| 16 | +cd mruby.github.io |
| 17 | +bundle install |
15 | 18 | ``` |
16 | 19 |
|
17 | | -Clone the repository: |
| 20 | +Serve the site locally with live reload: |
18 | 21 |
|
19 | 22 | ```shell |
20 | | -git clone https://github.com/mruby/mruby.github.io |
| 23 | +bundle exec rake serve |
| 24 | +# or use the convenience script: |
| 25 | +./server |
21 | 26 | ``` |
22 | 27 |
|
23 | | -Install Jekyll and its dependencies: |
| 28 | +## Build |
| 29 | + |
| 30 | +Runs all data generation tasks then builds the Jekyll site: |
24 | 31 |
|
25 | 32 | ```shell |
26 | | -cd mruby.github.io |
27 | | -bundle install |
| 33 | +bundle exec rake build |
28 | 34 | ``` |
29 | 35 |
|
30 | | -Preview the site: |
| 36 | +## Data generation tasks |
| 37 | + |
| 38 | +Each task can also be run individually: |
| 39 | + |
| 40 | +### `rake gen:mgemdata` |
| 41 | + |
| 42 | +Regenerates `_data/mgems.yml` from the mrbgems registry. Do not edit this file manually. |
| 43 | + |
| 44 | +```shell |
| 45 | +bundle exec rake gen:mgemdata |
| 46 | +``` |
| 47 | + |
| 48 | +### `rake gen:mrbdoc` |
| 49 | + |
| 50 | +Clones the latest stable mruby release into `mruby/`, generates YARD API documentation, and copies it to `docs/api/`. Requires the `gh` CLI. |
31 | 51 |
|
32 | 52 | ```shell |
33 | | -bundle exec jekyll serve |
34 | | -open "http://localhost:4000" |
| 53 | +bundle exec rake gen:mrbdoc |
35 | 54 | ``` |
| 55 | + |
| 56 | +### `rake gen:contributors` |
| 57 | + |
| 58 | +Generates `_data/contributors.yml` from the mruby `AUTHORS` file. Requires `mruby/` to exist (run `gen:mrbdoc` first). The `CONTRIBUTOR_THRESHOLD` environment variable sets the minimum commit count (default: 10). |
| 59 | + |
| 60 | +```shell |
| 61 | +bundle exec rake gen:contributors |
| 62 | +CONTRIBUTOR_THRESHOLD=20 bundle exec rake gen:contributors |
| 63 | +``` |
| 64 | + |
| 65 | +### `rake gen:releasedata` |
| 66 | + |
| 67 | +Generates `_data/releases.yml` from the GitHub API. Requires the `gh` CLI. |
| 68 | + |
| 69 | +```shell |
| 70 | +bundle exec rake gen:releasedata |
| 71 | +``` |
| 72 | + |
| 73 | +## Deployment |
| 74 | + |
| 75 | +GitHub Actions (`.github/workflows/pages.yml`) triggers on push to `master`. It runs `bundle exec rake build` (with `GH_TOKEN` set for the `gh` CLI calls) and deploys the result to GitHub Pages via `actions/deploy-pages`. |
| 76 | + |
| 77 | +## CI |
| 78 | + |
| 79 | +The lint workflow (`.github/workflows/lint.yml`) runs on all pull requests and checks for spelling errors (`misspell`) and merge conflict markers. |
0 commit comments