Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brob/madlibs
https://github.com/brob/madlibs
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brob/madlibs
- Owner: brob
- Created: 2021-04-10T17:35:52.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T02:49:38.000Z (about 1 year ago)
- Last Synced: 2024-04-11T15:46:39.083Z (9 months ago)
- Language: JavaScript
- Size: 362 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Madlib generator with Sanity, Netlify, and 11ty Serverless
This repository is a demo for this Smashing Magazine article.
🎉 [Try the Demo here](https://brob.dev/madlibs).
It creates a madlib generator that stores madlib templates and user-generated madlibs in a Sanity content lake. It builds static and server-rendered pages with 11ty, and uses Netlify On-Demand builders and serverless functions to add interactivity.
## Installation
### Configuring the studio
```bash
cd studio
npm install -g @sanity/cli
sanity install
sanity init
```The Sanity CLI will prompt to reconfigure the studio. You _do_ want to do this. Attach it to a Sanity project you own with a blank dataset.
### Running the site locally
The site requires the Netlify CLI tool to manage serverless functions and environment variables. If you don't have that installed globally run `npm install -g netlify-cli`.
```bash
cd site
npm install
netlify dev
```To pull data from YOUR Sanity project, you need to change the project ID from `/site/utils/sanityClient.js`. You'll also need to create an Editor token from your [Sanity dashboard](https://sanity.io/manage) and create a new environment variable in your [Netlify](https://netlify.com) project.
## Deployment
This repository contains two separate sites: the 11ty `site` and Sanity `studio`. It's not currently set up as a monorepo. The `site` directory is set to deploy to Netlify. The `studio` directory currently does not have deployment set up, but can be run locally or deployed to Sanity's hosted service with `sanity deploy`.