This repo contains an example blog application that is built with Astro, Cosmic and Start Bootstrap clean-blog template.
- Node (I recommend using latest version)
- Cosmic CMS account
git clone https://github.com/sumitkharche/astro-cosmic-app.git
cd astro-cosmic-app
npm install
Create a free account on Cosmic. If this is your first time using Cosmic, you'll see a short tutorial which will introduce some of the data types we'll be using - buckets, objects, and metafields.
Create a new empty bucket & name it coffee-blog. For each blog post, we will have three object types:
- Title
- Content
- Image
So, go ahead and add these properties in your buckets along with some data for those objects. If you're having trouble with Buckets, Objects, or Metafields, go ahead and read the Getting Started page really quickly for some startup instructions
In .env file,
- update your Cosmic bucket slug and read key
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:3000 |
npm run build |
Build your production site to ./dist/ |
Feel free to check Astro Docs and Cosmic Docs documentation.