STYLE & CLASS WEBSITE
This is the website for the Style & Class event series, powered by Jekyll.
To start contributing changes, clone this repo into a new folder and then on the command line:
- Install Jekyll if necessary (instructions at http://jekyllrb.com/)
- Install Grunt if necessary (instructions at http://gruntjs.com/)
- Navigate to the repo and install dependencies with
- Install this gem dependency:
gem install jekyll-sitemap(TODO: Gemfile)
- Go to the
- Run Jekyll server with
- Make your changes and test them locally
- Before sending up your changes, run all grunt tasks (CSS prefixing,
- Push your changes to Github and issue a pull request
Once you've committed your changes and pushed them to Github, please issue a Pull Request. We'll merge and deploy once we've had a chance to review.
S&C Organizers can deploy themselves using
Organizers may add additional organisers by running the following command:
npm install -g surge surge ./_site styleandclass.ca --add email@example.com
firstname.lastname@example.org is replaced with the new organizer’s email address. This will re-deploy the site and send an an email giving the new organizer permission to deploy the project too.
ADDING A PAGE
Adding pages is pretty simple. If the page is for an event, speaker or venue, skip this part and read the extra info below about those content types.
Choose where you want the page to live in the URL structure
Create a folder, and add an index.html or index.md file -- you can use either HTML or Markdown to build your page, see
/about/vision/index.mdfor examples of each, including required metadata.
Within the metadata, choose a layout (all layouts exist in
/_layouts/) and title your page. Use this syntax at the top:
--- layout: page title: This Page's Title ---
If your page needs to exist within the main navigation, add it to
Alternatively, just clone an existing page and update the metadata.
HOW CONTENT OBJECTS WORK
Our Event, Speaker, Talk, Sponsor and Venue data lives in JSON files within the
We've set up our content structures to be as modular as possible. Since Jekyll offers neither full blown CMS nor relational database, we're jumping through a few hoops to piece everything together. (It's entirely possible Jekyll was the wrong choice for this site, but, here we are.)
Each JSON data file contains an array of objects of a particular type. In order to link an object to a different data type -- ie. linking a talk to an event -- we need a linking key that's identical between both objects.
In most cases, this will be a key called
title. So for example, in
events.json file we have attached talks to each event via the
object. Each item in this object references a specific talk by the
which we would then lookup against
Each of these keys must be unique, and in order to properly link objects they must be identical between files. Here's how these keys map out between files:
events.talks.title == talks.title events.sponsors.sponsor == sponsors.name events.venue == venues.name talks.speaker == people.name
ADDING A SPEAKER, TALK, VENUE OR SPONSOR
None of these content types have their own individual pages, so you simply need
to add a new entry to the respective
For example, to add a new speaker:
/_data/people.jsonand append a clone of an existing person object at the end.
- Update details of the new person.
- If necessary, update
talks.jsonspeaker names to precisely match the name of this new person.
- Ensure that your JSON is valid.
We have listing pages for speakers and sponsors that you can visit to
confirm that your new addition is showing up properly. Visit
/about/sponsors/ in your browser.
Special note on speakers: since Jekyll doesn't provide the ability to sort data collections by a child key, we're hacking alphabetical order of speaker names by just doing it manually in the JSON file. If you add a new speaker, make sure to add them in the right alphabetical place in the file, by last name.
ADDING AN EVENT
It's likely that your event has new Speakers, Talks, and possibly even Sponsors or a new Venue. If that's the case, it's a lot easier if you add those objects first with the instructions above, then add the new event last.
To add an event:
/_data/events.jsonand append a clone of an existing event at the beginning.
- Update the event details to the new event.
- Ensure that venue, sponsor and talk names precisely match existing values in their respective data files. You'll likely need to create one or more of these, see that section below for details.
- Ensure that your JSON is valid.
Our content objects cause a bit of redundancy when creating events. Here's the part that's annoying and should be automated, but isn't:
- You'll also have to create a new folder for the event. It should live under
/events/YEAR/and should precisely match the
url-sitevalue you chose in
- Clone an existing event's
index.htmlinto that folder
- Update title and permalink in the new
index.htmlfile. Ensure they precisely match the values you chose in
Sometimes you'll find that events, people, talks, or venues don't show up as intended. To debug, you'll need to be familiar with how content objects work; make sure to read that section above.
The most common cause of missing content is non-identical linking keys. This can
spill out to unexpected places; for example, misspelling a person's name in
talks.json will prevent that talk from even showing up on an event page's talk
When you encounter missing content, check all linking keys between any of the possible content types. Copy and paste values to ensure they're identical.
If you're adding a second occurance of a content object (e.g. a talk) you may
find the site duplicates the talk listing if the title is identical. This is a
side effect of the way we're looping through each data file, and can easily be
side-stepped by either ensuring there's only a single instance of a talk in
You may want a second listing anyway to update certain details about the talk; in that case, just make sure the titles are somehow different from each other -- changing the case of a single character is a quick hack to accomplish that.
SPEAKERS AREN'T ALPHABETIZED
We're doing this manually; see the special note under the Adding Speakers section above.
JEKYLL IS THROWING LIQUID ERRORS
If you see something like the following:
Liquid Exception: Included file '_includes/partial-event-large.html' not found
The most likely culprit is that you ran
jekyll serve in
./, when you need to run it in