Astro-Sheets allows you to turn Google Sheets into a simple, lightweight headless CMS for building blogs or content-driven static sites using the Astro framework. Perfect for small projects or static sites needing easy, dynamic content management.
🌟 Demo: astro-sheets.vercel.app
📖 Detailed Guide: Google Sheets as a Simple CMS
📦 GitHub Template: astro-sheets
- Headless CMS using Google Sheets as the backend.
- Dynamic Content: Update your Google Sheets and reflect changes instantly on your site.
- SEO-friendly: Powered by Astro's SSR for optimal performance.
- Lightweight and Easy to Use: No complex setup—just Google Sheets and a few lines of code.
-
Clone the Template
git clone https://github.com/paulpietzko/astro-sheets cd astro-sheets npm install
-
Set Up Google Sheets as a CMS
- Create a Google Sheet with columns like Title, Author, Date, and Content.
- Follow the guide to create a WebApp Script for Google Sheets to fetch your data dynamically.
- Deploy the script and copy the resulting URL.
-
Connect Your Sheet to Astro
- Replace the Google Sheets WebApp URL in
src/pages/index.astro
with your own:
const res = await fetch("<Your WebApp URL>"); const data = await res.json();
- Replace the Google Sheets WebApp URL in
-
Run the Project
- Start the development server:
npm run dev
- Visit the local server at
http://localhost:4321
to see your blog in action!
Your project includes the following:
/
├── public/ # Static assets
├── src/
│ ├── pages/ # Pages like index.astro
│ └── components/ # Reusable UI components
└── package.json # Project configuration
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Builds the production site to ./dist/ |
npm run preview |
Previews your build locally before deployment |
npm run astro ... |
Run CLI commands like astro add , astro check |
npm run astro -- --help |
Get help using the Astro CLI |
Check out the live demo here: astro-sheets.vercel.app
- Detailed Guide: Google Sheets as a Simple CMS
- Astro Documentation: docs.astro.build
This project is licensed under the MIT License.