Here's how to edit this website!
Checkout this repo on github
Make changes and push to github (make sure you have collaborator privileges, and see later sections for details on specific kinds of changes)
Go to /afs/ir.stanford.edu/group/cocolab/cocolab.stanford.edu
and pull your changes
ssh [SUNetID]@cardinal.stanford.edu
cd /afs/ir.stanford.edu/group/cocolab/cocolab.stanford.edu
git pull
There's a script on the server that makes the changes live after a successful merge.
make a markdown file, e.g. new-file.md
in the top of the cocolab.stanford.edu
directory
add this to the top of the markdown file:
---
layout: default
---
if you want this page to appear in the navbar, add another value to the header:
---
layout: default
title: New Page
---
visit cocolab.stanford.edu/new-page.html
.
go to the file _data/cocolab.yml
find (or add) whatever role they play in the lab (e.g. Principal Investigator, Graduate Student, Alumni), and add a new person to that role.
- role: [WHATEVER ROLE]
people:
- [OTHER PEOPLE]
- name: New Person
img: newPerson.jpg
webpage: //www.stanford.edu/~newP
bio:
- >
A paragraph of this person's bio.
- >
Another paragraph of this person's bio.
- [OTHER PEOPLE]
_bibliography/cocolab.bib
and add the publication.got to the file _data/carousel.yml
add a new image to the end of the file
- [OTHER IMAGES]
- image: my-new-image.jpg
label: "A description of my new image"
alt: "if you want, you can add a line of alt text. otherwise, the label will be the alt text."
(for now...)
make changes to ndg-cv.md
have jekyll
, jekyll-scholar
, and pandoc
installed
run sh ./make-cv.bash
git add ndg-cv.md ndg-cv.pdf
If the website does not update within a minute or so of making these changes, this might be because the build script has stopped working. You can talk to Erin about this, or run
source /afs/ir.stanford.edu/group/cocolab/.bash_profile
jekyll build
rsync -r -a -v _site/* ../WWW/
in a terminal on the Stanford server in the /afs/ir.stanford.edu/group/cocolab/cocolab.stanford.edu
directory.
To set up installing ruby gems without sudo access, these lines should be in your ~/.bash_profile
(or ~/.bashrc
or whatever you use):
PATH=$PATH:~/.gem/bin:~/bin
export GEM_HOME=~/.gem
Once you've re-logged on or source
ed your profile file, you can install jekyll
and jekyll-scholar
using gem
. This site uses jekyll (2.5.3)
and jekyll-scholar (4.3.3)
.
gem install jekyll -v 2.5.3
gem install jekyll-scholar -v 4.3.3
Note that while jekyll
is compatible with GitHub pages, jekyll-scholar
is not.
Here's a possible .git/hooks/post-merge
script.
#!/bin/sh
export COCOHOME=/afs/ir.stanford.edu/group/cocolab
export PATH=${COCOHOME}/.gem/bin:$PATH
export GEM_HOME=${COCOHOME}/.gem
export GEM_PATH=$GEM_PATH:$GEM_HOME
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
cd /afs/ir.stanford.edu/group/cocolab/cocolab.stanford.edu/
jekyll build
rsync -r -a -v /afs/ir.stanford.edu/group/cocolab/cocolab.stanford.edu/_site/* /afs/ir.stanford.edu/group/cocolab/WWW/
For local debugging, one could run
jekyll build
and then navigate to _site/index.html
. Unfortunately, the links in this repo are currently hard-coded with the assumption that all files are present at the host (in the online version, http://cocolab.stanford.edu/
, in the local version file://
), so further abstraction and modifications would have to be made in order to actually navigate the site locally...