Run this website locally and deploy (macOS)

Run this website locally and deploy (macOS)

This repo is a Jekyll site (Minimal Mistakes theme) configured via the github-pages gem. You’ll run it locally with Ruby + Bundler, then deploy by copying the generated _site folder to Stanford AFS.

0) One‑time setup (macOS)

You only need to do this once on your Mac.

1) Install Xcode command line tools (compiler for native gems):

xcode-select --install

2) Install Homebrew (package manager):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

3) Install Ruby via rbenv and Node (Node is optional but handy for JS tasks):

brew install rbenv ruby-build node
echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc
exec $SHELL -l

# Install a stable Ruby (3.2.x is a good choice)
rbenv install 3.2.5
rbenv local 3.2.5

4) Install Bundler and project gems:

gem install bundler
bundle install

If bundle install errors, delete the lockfile and try again:

rm -f Gemfile.lock
bundle install

1) Run the site locally

In the repo root:

bundle exec jekyll serve --config _config.yml,_config.dev.yml

Then open http://localhost:4000 in your browser. Leave that terminal running while you edit content; changes will rebuild automatically.

Useful variants:

  • Serve on a different port: bundle exec jekyll serve --port 4001 --config _config.yml,_config.dev.yml
  • Stop the server: press Ctrl+C in the terminal.

2) Build for deployment

This generates a static site in _site/:

bundle exec jekyll build

If you need a clean rebuild:

bundle exec jekyll clean && bundle exec jekyll build
``;

### 3) Deploy to Stanford AFS

You want the contents of `_site/` copied to your AFS web directory: `/afs/cs.stanford.edu/u/<CSID>/www`.

Option A — via `rsync` over SSH (recommended):

```bash
rsync -av --delete _site/ <CSID>@corn.stanford.edu:/afs/cs.stanford.edu/u/<CSID>/www/

Option B — via scp:

scp -r _site/* <CSID>@corn.stanford.edu:/afs/cs.stanford.edu/u/<CSID>/www/

Notes:

  • Use VPN if you’re off campus and required by your environment.
  • Replace <CSID> with your Stanford CS login.
  • Your site will be served from https://ai.stanford.edu/~<CSID>/ (or your lab’s configured hostname).

4) Where to edit content

  • Pages: _pages/ (e.g., about.md, cv.md, publications.md, teaching.md)
  • Navigation, UI text: _data/navigation.yml, _data/ui-text.yml
  • Site‑wide settings: _config.yml (change and rebuild), _config.dev.yml (dev overrides)
  • Images/files: images/, files/

5) Common fixes

  • Missing compilers/headers: run xcode-select --install.
  • Gem install issues: rm -f Gemfile.lock && bundle install.
  • Port already in use: bundle exec jekyll serve --port 4001 --config _config.yml,_config.dev.yml.
  • Start fresh: bundle exec jekyll clean then bundle exec jekyll build or serve.

6) One‑liner TL;DR

# First time
xcode-select --install
brew install rbenv ruby-build node
echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc && exec $SHELL -l
rbenv install 3.2.5 && rbenv local 3.2.5
gem install bundler && bundle install

# Run locally
bundle exec jekyll serve --config _config.yml,_config.dev.yml

# Build and deploy
bundle exec jekyll build
rsync -av --delete _site/ <CSID>@corn.stanford.edu:/afs/cs.stanford.edu/u/<CSID>/www/