The LYF Website uses Sanity.io to store content.
- Download the repo to your computer:
git clone git@github.com:TACL-LYF/lyf-website-cms.git
- Add the Sanity CLI using
npm install -g @sanity/cli
oryarn add global @sanity/cli
- Run
yarn install
in order to download all the required packages- See installing yarn if you don't yet have yarn on your computer
- In
lyf-website-cms
, you can runyarn run dev
to see a locally running version of Sanity Studio - Run
sanity login
to get the right push credentials
- Login using the LYF Technology email and password option
- Use
yarn run deploy
to publish your changes.
- This will run a combination of
sanity deploy
which deploys the changes andsanity graphql deploy
which deploys the GraphQL changes
Sanity has a more comprehensive getting started guide if you want to learn more!
Sanity is built around schemas that define the kinds of content we support. Once we define a schema, we agree on what fields we can add and what fields will exist when we pull that content from the server. We define schemas for documents that store content. We can even define some fields to be re-used in multiple documents by creating objects.
- config/: Stores the configuration files for Sanity. Not super necessary for us to manage
- plugins/: Managed by Sanity. We can download additional plugins via Sanity's plugin system
- schemas/: The all-important folder that stores all of our supported schemas!
- static/: Sanity hosts a site for us to add content, and if we want assets in a known file path (for example: favicons) we can store them here
- deskStructure.ts: Sanity lets us define how we want to disply and organize documents. This file defines what we want that structure to look like
- package.json: Found in all npm packages. Defines a bunch of properties of the package including what other packages we depend on.
- sanity.json: Sanity's configuration file