Skip to content

Commit 410d8e6

Browse files
committed
docs: add a bit more detail to webdev, Ruby 3.2
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 89f4773 commit 410d8e6

File tree

3 files changed

+38
-10
lines changed

3 files changed

+38
-10
lines changed

Diff for: .gitattributes

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
21
*.min.* binary
2+
*.svg binary
3+
34
# GitHub syntax highlighting
45
pixi.lock linguist-language=YAML linguist-generated=true

Diff for: .github/actions/prepare-build-site/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
ruby-version:
55
description: "Version of ruby to prepare"
66
required: false
7-
default: "3.1"
7+
default: "3.2"
88

99
runs:
1010
using: composite

Diff for: pages/docs/webdev.md

+35-8
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,39 @@ You can always click the edit button to make small edits to the website source,
1515

1616
#### Installing Ruby
1717

18-
Visit [this page](https://jekyllrb.com/docs/installation/) for information about installing Ruby if your current version is too old; the instructions there form the basis for what you see here, and come in variants for all major operating systems.
19-
You should have Ruby 2.6+ for Jekyll; 3.1 recommended and used in CI. You can use rbenv to manage multiple ruby versions. On macOS with homebrew, you'll want:
18+
Visit [this page](https://jekyllrb.com/docs/installation/) for information
19+
about installing Ruby if your current version is too old; the instructions
20+
there form the basis for what you see here, and come in variants for all major
21+
operating systems. You should have Ruby 2.6+ for Jekyll; 3.1+ recommended and
22+
used in CI. You can use rbenv to manage multiple ruby versions. On macOS with
23+
homebrew, you'll want:
2024

2125
```bash
2226
brew install rbenv
2327
```
2428

25-
You'll need to run `rbenv init` and follow the instructions for your current shell. After you've installed rbenv on your system, use:
29+
You'll need to run:
2630

2731
```bash
28-
rbenv install 3.1.2
32+
rbenv init
2933
```
3034

31-
to get a current version of ruby. Then, inside the main iris-hep website directory, run:
35+
and **then follow the instructions printed for your current shell**. After you've installed rbenv on your system, use:
3236

3337
```bash
34-
rbenv local 3.1.2
38+
rbenv install 3.2.1
3539
```
3640

37-
This will run the Ruby you just built whenever you enter this directory. You'll want to install bundler too:
41+
to get a current version of Ruby downloaded and built for your system. Then,
42+
inside the main iris-hep website directory, run:
43+
44+
```bash
45+
rbenv local 3.2.1
46+
```
47+
48+
This will add a file (`.ruby-version`, if you are curious) to your local
49+
directory that rbenv's shell integration will enable whenever you enter this
50+
directory. You'll want to install bundler too:
3851

3952
```bash
4053
gem install bundler
@@ -76,7 +89,7 @@ If you want to also perform the full link checking without exclusions, you can r
7689
bundle exec rake checkall
7790
```
7891

79-
If you are not familiar with it, `rake` is short for "Ruby make". The `clean` and `clobber` targets are available (the later removes the Inspire-HEP cache as well). You can also run `bundle exec jekyll ...` directly.
92+
If you are not familiar with it, `rake` is short for "Ruby make". The `clean` and `clobber` targets are available (the later removes the Inspire-HEP cache as well). You can see all available tasks with `bundle exec rake --tasks`. You can also run `bundle exec jekyll ...` directly.
8093

8194
### Using `pixi`
8295

@@ -130,6 +143,20 @@ cat assets/js/myfile.js | openssl dgst -sha384 -binary | openssl base64 -A
130143

131144
Run the site locally and verify no warnings appear in your terminal. Also turn on your browser's debugger and make sure no warnings are emitted.
132145

146+
### Updating Ruby files
147+
148+
If you edit Ruby files, you should run `rubocop` to verify:
149+
150+
```bash
151+
bundle exec rake rubocop
152+
```
153+
154+
If it suggests changes, you can often apply them automatically:
155+
156+
```bash
157+
bundle exec rake rubocop:auto_correct
158+
```
159+
133160
### Styles
134161

135162
Most style changes should be set in `assets/css/style.scss`. Some basic changes, like color variables, are set in the `_sass` directory. Please remember to consider multiple screen widths, printing (for relevant pages), and dark mode when changing or adding styles. You can see the defined colors [here](/docs/logos).

0 commit comments

Comments
 (0)