stoplight.io, Best in class API Design, Docs, Mocking, and Testing.
- React Static - A progressive static site generator for React
- Tailwind - A utility-first CSS framework for rapidly building custom designs
- Fontawesome - Vector icons and social logos
- Netlify - Continuous deployment and hosting
- Netlify CMS - Open source content management for your Git workflow
- netlify: Content files created in NetlifyCMS that power the src/templates
- public: Static files that are copied into
dist
at build time such as images - src/templates: Templates receive data from content files in /netlify and are rendered into static HTML pages
- src/components: Reusable React components that are used by src/templates
- src/utils: Utility functions used by components and the build process
- static.config.js: The react-static configuration file used to build the site
- Run
yarn install
to install the sites dependencies - Run
yarn start
to start the local development server - Go to http://localhost:3000
A route is a combination of a content file in ./netlify, a template in ./src/templates, and a browser path.
- Read the react-static docs on adding a route.
- Add a route to getRoutes function.
Here's an example:
{
path: '/enterprise', // Creates a route for /enterprise
template: 'src/templates/Enterprise', // Loads the Enterprise template whenever a user lands on /enterprise
getData: () => getFile(`./netlify/pages/enterprise.yaml`), // Reads the file data from the enterprise.yaml file and passes it into the Template
},
- Create a new folder in
src/templates/{page name}
. - Add an
index.tsx
file that default exports a React component. - Add a
config.js
that exports the NetlifyCMS configuration for the page.
# starts the local development server
yarn start
# build for a staging environment
yarn build
# build the production environment
yarn build.production
# outputs an analysis of the build
yarn build.analyze
# starts a local server running a build in /dist
yarn serve
# runs the typescript linter
yarn lint
RELEASE_STAGE
: determines which environment to run: development, staging or productionCLOUDINARY_API_KEY
: used by the admin portal for uploading images to Cloudinary
This project is licensed under the MIT license.