Website for Sabby Gallery, made in Eleventy.
- Install Node.js
- Code Editor (VSCode, Sublime Text, etc.) for making changes.
- Git for pushing updates (if you have access to this repo)
Check whether you have Node installed correctly by running node --version in a terminal window.
Node includes npm (Node Package Manager), so you should also be able to run npm -v as well.
- Clone/download this repository (extract the
.zipif downloading) - Open the
/sabby/folder in your terminal window. - Run
npm installto install dependencies. - Run
npm startto serve a local version of the website, which you can open in your browser for testing. (e.g.https://localhost:8080)
If you just want to make content updates (e.g. adding new events), then you only need to pay attention to the following subfolder:
sabby/src/events/
This folder contains Markdown files for each event, which look like this:
05-zine-club.md
---
title: Zine Club
date: 2024-05-18
tags: [zine-club]
poster: "ZineClub-May2024.jpg"
blurb: "Zine Club is back in May!"
---
Come hang out, make a zine or two.
Supplies are provided but feel free to BYO if you have extra stuff you want to use (and share!).
From 2 p.m. to 6 p.m.Each file contains YAML frontmatter containing all the necessary info for the event.
| name | description |
|---|---|
title |
Name of the event |
date |
Date of the event, formatted as YYYY-MM-DD |
tags |
Additional tag data (currently unused) |
poster |
Name of image file located in src/images/posters/ |
blurb |
Short summary displayed on the /events/ page |
The body of the markdown is simply used as the full event description (shown on the event's page).
To make a new event, simply create a new file (following the naming convention MM-event-name.md (MM = month), copypaste then edit the frontmatter from another event.
To make a file not appear in the build, add the field
draft: trueto the frontmatter.
If you are already running a local server (by running npm start), the website should automatically update when you save.
You can use this to preview and verify your changes before committing them to the repo.
To add new posters, make sure to place them in the following subfolder
sabby/src/img/posters/
If you need to update/edit pages, you can find most of them in sabby/src/_pages. These are Nunjucks files which should be fairly simple to edit, and have access to Eleventy's Data Cascade to conveniently pull data from other places.
Rather than writing an extensive tutorial here, please refer to Eleventy's documentation.
In any case, a few tips to help you around:
src/_/contains files that are passed through to the final output.src/_includes/_data/contains JSON data that can be referenced using Nunjucks (e.g.{{site.title}}refers to "title" in_data/site.json)src/_includes/partialscontains reusableNunjuckssnippets that can be used around the site.
This repo is currently set up with Github Actions so that commits pushed to origin/main trigger an automatic build + deployment to the live site. Basically, the website will automatically update whenever you push your changes to the repo - easy!
The
origin/livebranch is used byGithub Actionsto serve the site and should never be pushed to directly.
If you are stuck or need help, please ask @heygleeson or @jemztones!