You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/docs/webdev.md
+35-8
Original file line number
Diff line number
Diff line change
@@ -15,26 +15,39 @@ You can always click the edit button to make small edits to the website source,
15
15
16
16
#### Installing Ruby
17
17
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:
20
24
21
25
```bash
22
26
brew install rbenv
23
27
```
24
28
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:
26
30
27
31
```bash
28
-
rbenv install 3.1.2
32
+
rbenv init
29
33
```
30
34
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:
32
36
33
37
```bash
34
-
rbenv local 3.1.2
38
+
rbenv install 3.2.1
35
39
```
36
40
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:
38
51
39
52
```bash
40
53
gem install bundler
@@ -76,7 +89,7 @@ If you want to also perform the full link checking without exclusions, you can r
76
89
bundle exec rake checkall
77
90
```
78
91
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.
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.
132
145
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
+
133
160
### Styles
134
161
135
162
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