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: README.md
+114Lines changed: 114 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,120 @@ Built using [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes) an
6
6
7
7
This repository contains all the code for the blastnet.github.io website. Most of the Minimal Mistakes features and layouts are not used (and will likely never be used) and so they have been removed for a smoother and lighter build experience. Yet, some new features like the data counters have also been added. Therefore, please read this documentation carefully.
8
8
9
+
## Getting started
10
+
11
+
In order to build the site, a local installation of [Jekyll](https://jekyllrb.com) and [Ruby](https://www.ruby-lang.org/en/) is required.
12
+
13
+
### MacOS
14
+
15
+
MacOS comes preinstalled with Ruby, but it is generally not recommended to use the system Ruby. Therefore, first install `chruby` and `ruby-install` with [Homebrew](https://brew.sh/) (if you don't have Homebrew on your Mac, install that first!).
16
+
```bash
17
+
brew install chruby ruby-install
18
+
```
19
+
20
+
Now, install a stable version of Ruby (e.g. 3.4.1):
21
+
```bash
22
+
ruby-install ruby 3.4.1
23
+
```
24
+
25
+
Configure the shell to automatically use `chruby` so that the system Ruby will not cause issues:
echo"chruby ruby-3.4.1">>~/.zshrc # run 'chruby' to see actual version
30
+
```
31
+
32
+
Finally, **quit and relaunch the terminal**, then verify Ruby is working (`ruby -v`) and install Jekyll:
33
+
```bash
34
+
gem install jekyll
35
+
```
36
+
37
+
### Linux (Debian, Ubuntu, Mint)
38
+
39
+
Linux OS generally does not come preinstalled with Ruby, so you will need to install it yourself. Personally, I recommend using a Ruby manager like `rvm`, but you can just install the Ruby library and other prerequisites like so:
Install RubyInstaller for Windows from https://rubyinstaller.org/downloads/ and ensure that you tick ridk install at the end to install MSYS2 and development tools. Click Enter twice. If you did not tick, then open a session in Powershell and type:
59
+
```
60
+
ridk install
61
+
```
62
+
63
+
In Powershell, verify installation with
64
+
```ruby -v
65
+
gem -v
66
+
```
67
+
68
+
Install Jekyll and the bundler with
69
+
```
70
+
gem install jekyll bundler
71
+
```
72
+
73
+
---
74
+
75
+
## Building the site
76
+
77
+
First, clone the repository:
78
+
```bash
79
+
git clone https://github.com/ihmegroup/website
80
+
```
81
+
82
+
You can also fork the repository and clone that, if you prefer.
83
+
84
+
Then, `cd website` and install dependencies:
85
+
```bash
86
+
bundle install
87
+
```
88
+
89
+
The site is now ready to be built using the following command:
90
+
```bash
91
+
bundle exec jekyll build
92
+
```
93
+
94
+
If you'd like to preview, you can also run
95
+
```bash
96
+
bundle exec jekyll serve
97
+
```
98
+
which will build the site and run a daemon on your local machine.
99
+
100
+
There are some options/flags that this command takes, the most pertinent of which is `--livereload` (which will cause the browser to refresh every time the site is rebuilt, i.e., every time a file is updated). If you run into an error saying the port is unavailable, chances are that you have another instance of Jekyll running already (either because you are also working on another site at the moment, or because you forgot to terminate Jekyll the last time). If you'd like to work on multiple Jekyll sites at the same time, you can specify a different port (e.g. `--port 4001`). The default port is `4000`, so to preview the site in your browser, enter the URL `localhost:4000`.
101
+
102
+
### Important
103
+
104
+
Make sure to correctly set the `url` and `baseurl` fields in `_config.yml` before building the webpage. The url should be `fxlab.stanford.edu` and baseurl blank, do not delete it.
105
+
106
+
---
107
+
108
+
## Pushing to production
109
+
110
+
**Never push to production on Fridays!** (jk)
111
+
112
+
Once the site has been built, all the relevant files will be in the `_site` folder, ready to be uploaded to the Stanford domain. I also recommend cleaning up the CSS to remove unused classes, which speeds up loading time and reduces filesize, this can be done by running
113
+
114
+
```bash
115
+
purgecss -c purgecss.config.js
116
+
```
117
+
which will replace the CSS files in the `_site/assets/css/` folder with the purged css files.
118
+
119
+
If using Github pages, simply run `bundle exec jekyll clean` to remove the build files, then commit changes and push to the `main` branch. I do recommend making major code-breaking or other stylistic changes on a development branch or fork, before making a pull request to the main branch.
0 commit comments