It is recommended you are running Linux or Mac OSX to contribute. If running Windows, you can set up a Linux virtual machine using VirtualBox.
- Install Git
- If you don't have one, create an account on GitHub and email a member of the UNH-CORE organization (e.g. Pete) your user name to be added.
- Open a terminal or command prompt in a folder you'd like to place the site subdirectory, e.g. your
user home folder (Windows users can navigate to the folder in Windows Explorer and right click
"Git bash here") and execute
git clone https://github.com/UNH-CORE/unh-core.github.io.git
- Edit/create content inside the Markdown (
*.md
) files. See existing files in the_posts
directory for examples. Also see the section below about creating a new post. - Preview your changes locally (see section below). You can see a summary of files modified by executing
git status
, or see the changes individually withgit diff
. - If your changes are acceptable, stage all for a commit by executing
git add -A
in the terminal, then commit withgit commit -m "Your commit message goes here"
. A commit message should be descriptive of the changes made, e.g., "Create post about 2014 wave device experimental data set". - Upload or "push" your changes to the repository on GitHub by executing
git push
. - Repeat steps 4--7 as necessary.
To be able to build the site locally, you will need to be running Linux or Mac OSX, with (Ubuntu command for installing)
- Ruby (
sudo apt-get install ruby-dev
) - Jekyll (
sudo gem install jekyll
) - Node.js (
sudo apt-get install nodejs
)
Of course, all text files can be edited directly from the repository on GitHub, but you will not be able to preview changes.
In a terminal, execute
jekyll serve --watch
Then, in a browser, navigate to http://0.0.0.0:4000/. As Markdown (*.md
) and HTML files are edited,
the local server will update the site automatically.
First, you'll need to have Rake installed (sudo apt-get install rake
), then
in a terminal, execute
rake post title="This is the title" category="insert-category-here"
This post will be generated automatically (named properly) in the _posts
directory. Open the new file with
a text editor and write your post. Jekyll will automatically generate the necessary HTML.
The site is set up to automatically typeset math via Mathjax. For inline math use, e.g., $$f = ma$$
, otherwise
use
$$
f = ma
$$
See the issues on GitHub.
We can either upload the entire site folder to the UNH server---via FTP for example---or get the UNH
domain name to point at GitHub servers. The latter is probably easiest, since updating the site would
require that a user simply push
the changes to the repository, since GitHub builds the site on their
servers.