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-8Lines changed: 35 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -13,26 +13,39 @@ You can always click the edit button to make small edits to the website source,
13
13
14
14
### Installing Ruby
15
15
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:
18
22
19
23
```bash
20
24
brew install rbenv
21
25
```
22
26
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:
24
28
25
29
```bash
26
-
rbenv install 3.1.2
30
+
rbenv init
27
31
```
28
32
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:
30
34
31
35
```bash
32
-
rbenv local 3.1.2
36
+
rbenv install 3.2.1
33
37
```
34
38
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:
36
49
37
50
```bash
38
51
gem install bundle
@@ -75,7 +88,7 @@ If you want to also perform the full link checking without exclusions, you can r
75
88
bundle exec rake checkall
76
89
```
77
90
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.
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.
89
102
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
+
90
117
### Styles
91
118
92
119
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