Skip to content

Commit bb59d95

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

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11

22
*.min.* binary
3+
*.svg binary

.github/actions/prepare-build-site/action.yml

Lines changed: 1 addition & 1 deletion
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

pages/docs/webdev.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,39 @@ You can always click the edit button to make small edits to the website source,
1313

1414
### Installing Ruby
1515

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

1923
```bash
2024
brew install rbenv
2125
```
2226

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

2529
```bash
26-
rbenv install 3.1.2
30+
rbenv init
2731
```
2832

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

3135
```bash
32-
rbenv local 3.1.2
36+
rbenv install 3.2.1
3337
```
3438

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

3750
```bash
3851
gem install bundle
@@ -75,7 +88,7 @@ If you want to also perform the full link checking without exclusions, you can r
7588
bundle exec rake checkall
7689
```
7790

78-
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.
91+
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.
7992

8093
### Updating javascript files
8194

@@ -87,6 +100,20 @@ cat assets/js/myfile.js | openssl dgst -sha384 -binary | openssl base64 -A
87100

88101
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.
89102

103+
### Updating Ruby files
104+
105+
If you edit Ruby files, you should run `rubocop` to verify:
106+
107+
```bash
108+
bundle exec rake rubocop
109+
```
110+
111+
If it suggests changes, you can often apply them automatically:
112+
113+
```bash
114+
bundle exec rake rubocop:auto_correct
115+
```
116+
90117
### Styles
91118

92119
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)