Initial import of sproutblog

This commit is contained in:
萌小芽
2026-04-14 13:17:55 +08:00
commit 276a7fbc83
7 changed files with 749 additions and 0 deletions

13
migrations/0001_init.sql Normal file
View File

@@ -0,0 +1,13 @@
CREATE TABLE IF NOT EXISTS posts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
excerpt TEXT DEFAULT '',
content TEXT NOT NULL,
published INTEGER NOT NULL DEFAULT 1,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_posts_published_updated_at
ON posts (published, updated_at DESC);

View File

@@ -0,0 +1,22 @@
INSERT INTO posts (title, slug, excerpt, content, published, created_at, updated_at)
VALUES (
'Hello World',
'hello-world',
'第一篇测试文章。',
'# Hello World
这是 SproutBlog 的第一篇文章。
它使用标准 Markdown 渲染,并且页面保持纯白、极简。
## 说明
- 这是一个示例段落
- 这是一个示例列表
> 如果你看到这篇文章,说明 D1 和 Worker 已经正常工作。
',
1,
datetime('now'),
datetime('now')
);