welcome! Unlock NYC builds digital tools to make the apartment search process transparent, fair, and free from discrimination for all New Yorkers.
🤖🏡 This project hosts our main website.
-
front-end/CMS: we use Tina to edit content in Markdown files. Any changes in Tina are automatically committed to this repo.
-
deployment/hosting: we use Netlify to serve the website over the net - it's automatically set up to trigger a build whenever anything in this repo changes.
-
static site generator: this site is built with 11ty!
-
images/content CDN: we use Digital Ocean Spaces as object storage.
-
functions: we use Netlify functions to authenticate advocates who have logins and are reporting on behalf of others, and to connect the Tina CMS Media Manager to Digital Ocean.
-
in the
_includes
folder, you'll find all the site's template files, written in Nunjucks. When 11ty runs, it uses these files to generate HTML pages and stores them in a folder calledbuild.
You won't see thebuild
folder in this repo! It's generated every time 11ty runs, and hidden via the.gitignore
file. -
the rest of the
.md
files hold the content and metadata, either pulled from various places (for example, thebios
collection holds content that gets displayed on the About page, via theabout.njk
template) or simply from the root folder. 11ty takes any Markdown file and turns it into a folder with a correspondingindex.html
. For example,press.md
turns into a folder (/press
) with an index (/press/index.html
) inside it, so that the URLhttps://weunlock.nyc/press
works. -
the
public/styles
folder holdssite.css
- other css files are inside the_includes
folder, so that they can be pulled onto specific pages via Nunjuck templates. -
.eleventy.js
is the 11ty configuration file - it sets the output folder tobuild
, and allows for thestyles
andscripts
folders to be bundled into the output folder too so we can use them. -
tina/config.ts
is the Tina configuration file, for building out the schema of the CMS.
-
to work on the site locally, download the code and in the root folder run:
npm install npx tinacms dev -c "npx @11ty/eleventy --serve"
This should give you both Tina CMS and the 11ty site on a
localhost
. -
remember to run
git pull
before trying to push code to a new branch on the github! -
also remember, any
push
to themain
branch on the github will trigger a Netlify deploy and change the site. to preview first, upload to another branch and make a pull request. -
note: the deploy previews & checks in Github rarely pass, even when the project builds locally and in Netlify
-
having issues with TinaCMS build? check out their Discord, it can be helpful!
-
another troubleshooting tip: if all else fails, try "reindexing"
main
from within TinaCloud (🦙)
-
Tina documentation - for configuring the CMS
-
11ty documentation - there's so much here, if you go digging!
🛠 feel free to add to this list!