Logo
RavenSaaS Docs

Blog System

Blog Overview

RavenSaaS has a built-in CMS system for blog content management with multi-language support. Through the visual management backend, you can easily create and manage blog content.

Configure CMS

Before using the blog functionality, you need to complete database configuration and admin backend configuration.

Create Data Table

You need to create a data table in the database to store blog content:

data/install.sql
1CREATE TABLE posts (
2    id SERIAL PRIMARY KEY,
3    uuid VARCHAR(255) UNIQUE NOT NULL,
4    slug VARCHAR(255),
5    title VARCHAR(255),
6    description TEXT,
7    content TEXT,
8    created_at timestamptz,
9    updated_at timestamptz,
10    status VARCHAR(50),
11    cover_url VARCHAR(255),
12    author_name VARCHAR(255),
13    author_avatar_url VARCHAR(255),
14    locale VARCHAR(50)
15);

Manage Blog Content

1. Enter Blog Backend

Access the blog management backend to view the blog list (empty by default):

Terminal
1https://{your-domain}/admin/posts
Enter Blog Backend
Enter Blog Backend

2. Add Blog Content

Blog title and access route (slug) are required. Multi-language support is available by default, you need to select the corresponding language.

Add Blog Content
Add Blog Content

AI-generated blog content is also supported (requires AI configuration)

AI-generated blog content is also supported (requires AI configuration)
AI-generated blog content is also supported (requires AI configuration)

3. View Blog Content

Open the blog route to view blog content:

Terminal
1https://{your-domain}/{locale}/posts/{slug}
View Blog Content
View Blog Content

4. View Blog List

Access the blog list frontend route to see the blog content added in the backend:

Terminal
1https://{your-domain}/{locale}/posts
View Blog List
View Blog List

Configure Blog Routes

The default blog route is /posts, you can customize blog routes as needed.

Default Routes

Blog List

Access blog list page:

/{locale}/posts

Blog Detail

Access blog detail page:

/{locale}/posts/{slug}

Custom Routes

If you want to use other blog routes, for example:

  • /blogs /blogs to access blog list
  • /blog/:slug /blog/:slug to access blog details

You need to add custom folders and refer to the app/[locale]/posts folder to organize custom code.

Terminal
1app/[locale]/
2├── blogs/
3│   ├── page.tsx          # 博客列表页
4│   └── [slug]/
5│       └── page.tsx      # 博客详情页
6└── blog/
7    └── [slug]/
8        └── page.tsx      # 另一种博客详情页路由

Last updated on January 5, 2025