stanford-rc / globus.stanford.edu

globus.stanford.edu — The Globus @ Stanford web site
https://globus.stanford.edu/
Other
3 stars 4 forks source link
globus stanford

globus.stanford.edu

This is the source code for the Globus @ Stanford web site!

Anything pushed to the main branch will go live at https://globus.stanford.edu/.

This site uses the Jekyll template engine. We do that because that is what GitHub Pages uses, and we are using GitHub Pages to publish our content!

This site uses the Lagunita theme, which Karl converted to be used with Jekyll. It is simple enough that GitHub Pages is able to build the site itself, so we don't need any external stuff (like Travis CI) to build.

How to Test Locally

It is pretty easy, with a little bit of sysadmin skill, to test your changes locally before you push them!

All operations will be done inside a terminal window (on macOS and Linux), or in a PowerShell window (on Windows). Here's what to do:

Step 1: Get Ruby, Bundler, and Git

This depends on your OS:

Once you have all the software installed, launch your terminal (or PowerShell on Windows) and run two commands:

git config --global user.email "sunetid@stanford.edu"
git config --global user.name "Your Name"

In the commands above, replace sunetid with your SUNetID, and replace Your Name with your name. Git will add that information to each commit you make.

Step 2: Get the repo

If you have never used the GitHub CLI (the gh command), run gh auth login to log in to GitHub. You will be asked a number of questions; here are the answers:

You will be shown a unique, one-time code. When prompted, press the Return key to open your web browser, which will take you to the GitHub login page: Log in to GitHub, and then enter the one-time code.

Once the one-time code is entered, after a short delay, the GitHub CLI should say "Authentication complete" and "Logged in".

One you have authenticated to GitHub, you should now cd to wherever you would like the repository to live, and then run gh repo clone stanford-rc/globus.stanford.edu to clone the repository to your computer.

If you already have the repository cloned to your machine, you do not need to clone it again. Insted, you can update your existing clone. cd to the repository, and run gh repo sync.

Step 3: Get the dependencies

All of these commands are run in your terminal (or PowerShell on Windows). First, cd to your cloned repository.

If you have just cloned the repository from GitHub, there is a setup step you need to complete:

This one-time setting will ensure Ruby dependencies are installed inside the cloned repository.

Finally, run bundle install (if you are using MacPorts, run bundle3.2 install). This will download the Ruby software needed to work on this web site. The software will be installed inside the clone directory, so it will not modify your Ruby installation.

You should run bundle install any time you make a new clone, and also after pulling in changes from the repository (using gh repo sync).

Step 4: Run Jekyll

In your Terminal (or PowerShell on Windows), cd to the root of the repository. Then, run bundle exec jekyll serve. This will run Jekyll, which will build the site.

NOTE: If you are using MacPorts, the command is bundle3.2 exec jekyll serve.

Once the static HTML has been built, Jekyll will start a local web server. Launch your web browser, and go to the URL provided by Jekyll. There's the site!

You can now make edits. As you save your changes, you will see Jekyll rebuilding the static HTML pages.

When you are done, press Control-C to stop the temporary Jekyll server. On Windows, you will twice be asked if you want to "Terminate batch job?" Answer Y both times, and the temporary Jekyll server will exit.