Cocolab.stanford.edu
CoCoLab website with automatically updated pages and publications using `jekyll` and `jekyll-scholar`
Install / Use
/learn @stanford-cocolab/Cocolab.stanford.eduREADME
layout: default
Here's how to edit this website!
Overview
-
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.eduand pull your changesssh [SUNetID]@cardinal.stanford.edu cd /afs/ir.stanford.edu/group/cocolab/cocolab.stanford.edu git pullThere's a script on the server that makes the changes live after a successful merge.
Specific kinds of changes
How to add a new page to the website
-
make a markdown file, e.g.
new-file.mdin the top of thecocolab.stanford.edudirectory -
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.
How to add a person to the website
-
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]
How to add a publication to the website
- go to the file
_bibliography/cocolab.biband add the publication.
How to add an image to the front page carousel
-
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."
How to update Noah's CV
(for now...)
-
make changes to ndg-cv.md
-
have
jekyll,jekyll-scholar, andpandocinstalled -
run
sh ./make-cv.bash -
git add ndg-cv.md ndg-cv.pdf
Troubleshooting
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.
Set up
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 sourceed 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...
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
