Skip to content

Commit

Permalink
docs: add a bit more detail to webdev, Ruby 3.2
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 12, 2023
1 parent 79a8df2 commit bb59d95
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

*.min.* binary
*.svg binary
2 changes: 1 addition & 1 deletion .github/actions/prepare-build-site/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
ruby-version:
description: "Version of ruby to prepare"
required: false
default: "3.1"
default: "3.2"

runs:
using: composite
Expand Down
43 changes: 35 additions & 8 deletions pages/docs/webdev.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,39 @@ You can always click the edit button to make small edits to the website source,

### Installing Ruby

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.
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:
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. 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:

```bash
brew install rbenv
```

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

```bash
rbenv install 3.1.2
rbenv init
```

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

```bash
rbenv local 3.1.2
rbenv install 3.2.1
```

This will run the Ruby you just built whenever you enter this directory. You'll want to install bundler too:
to get a current version of Ruby downloaded and built for your system. Then,
inside the main iris-hep website directory, run:

```bash
rbenv local 3.2.1
```

This will add a file (`.ruby-version`, if you are curious) to your local
directory that rbenv's shell integration will enable whenever you enter this
directory. You'll want to install bundler too:

```bash
gem install bundle
Expand Down Expand Up @@ -75,7 +88,7 @@ If you want to also perform the full link checking without exclusions, you can r
bundle exec rake checkall
```

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

### Updating javascript files

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

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.

### Updating Ruby files

If you edit Ruby files, you should run `rubocop` to verify:

```bash
bundle exec rake rubocop
```

If it suggests changes, you can often apply them automatically:

```bash
bundle exec rake rubocop:auto_correct
```

### Styles

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).
Expand Down

0 comments on commit bb59d95

Please sign in to comment.