Skip to content

@studiocms/blog

Introduction

Powered by astro-theme-provider by Bryce Russell

This Astro integration enables the StudioCMS Blog feature in your Astro project. This integration will allow you to create, edit, and delete blog posts in the StudioCMS dashboard.

Installation

  1. Install the package and add to your astro config using the following command:

    Terminal window
    npx astro add @studiocms/blog
  2. Update your config file as shown under Example Config below.

Usage

What does this integration do?

This integration will add the following new routes to your StudioCMS Controlled front-end:

  • /blog - The main blog page that lists all blog posts.
  • /blog/[slug] - The individual blog post page.
  • /rss.xml - The RSS feed for your blog posts.

Example config

astro.config.mjs
import { defineConfig } from 'astro/config';
import db from '@astrojs/db';
import studioCMS from 'studiocms';
import studioCMSBlog from '@studiocms/blog';
// https://astro.build/config
export default defineConfig({
site: "https://example.com",
output: "server",
adapter: ...
integrations: [
db(), // REQUIRED - `@astrojs/db` must be included in the integrations list
studioCMS(), // REQUIRED - StudioCMS must be included in the integrations list
studioCMSBlog({
config: {
title: "My StudioCMS Blog",
description: "A Simple Blog build with Astro, Astrojs/DB, and StudioCMS.".
},
}),
],
});