Blog
ShipAny has a built-in CMS system for blog content management with multi-language support.
Configuring CMS
First, make sure you have completed the database configuration.
To visually manage blog content, you need to configure the admin dashboard.
You need to create a database table to store blog content:
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
uuid VARCHAR(255) UNIQUE NOT NULL,
slug VARCHAR(255),
title VARCHAR(255),
description TEXT,
content TEXT,
created_at timestamptz,
updated_at timestamptz,
status VARCHAR(50),
cover_url VARCHAR(255),
author_name VARCHAR(255),
author_avatar_url VARCHAR(255),
locale VARCHAR(50)
);
Managing Blog Content
- Access the blog admin panel
https://{your-domain}/admin/posts
View the blog list. (Empty by default)
- Add blog content
The blog title and access route (slug) are required fields. Multi-language support is enabled by default, and you need to select the corresponding language.
- View blog content
Open the blog route to view the blog content
https://{your-domain}/{locale}/posts/{slug}
- View blog list
Visit the blog list frontend route to see the blog content added in the admin panel.
https://{your-domain}/{locale}/posts
Configuring Blog Routes
The default blog route is /posts
. After adding blog content following the steps above, you can add navigation items in the i18n/pages/landing
JSON files to display the blog list entry.
If you want to use different blog routes, such as:
/blogs
to access the blog list/blog/:slug
to access blog details
You need to add custom folders and refer to the app/[locale]/(default)/posts
folder to organize your custom code.