This commit is contained in:
1 parent
c1541b80df
commit
b4c7908029
97 files changed
+12403
-154
No files matched your search
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* 文章领域类型。
|
||||
*
|
||||
* 数据源已从 `content/posts/*.mdx` 文件迁移到 PostgreSQL 的 `posts` 表。
|
||||
* 为了不改动页面层与 MDX 渲染管线,这里保留了原有的字段命名
|
||||
* (`date`、`draft` 等),由 `lib/posts/repository.ts` 负责
|
||||
* 在数据库行与这些类型之间做映射。
|
||||
*/
|
||||
|
||||
/** 文章的公共元信息 */
|
||||
export interface PostFrontmatter {
|
||||
/** 标题 */
|
||||
title: string;
|
||||
/** 发布日期,格式 YYYY-MM-DD */
|
||||
date: string;
|
||||
/** 摘要,用于卡片与 SEO description */
|
||||
summary: string;
|
||||
/** 标签 */
|
||||
tags?: string[];
|
||||
/** 是否为草稿;为 true 时不参与任何列表、详情与 sitemap 输出 */
|
||||
draft?: boolean;
|
||||
/** 封面图路径 */
|
||||
cover?: string;
|
||||
/** 覆盖默认 SEO 描述 */
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/** 列表页使用的文章摘要信息(不含正文) */
|
||||
export interface PostMeta extends PostFrontmatter {
|
||||
/** URL 标识 */
|
||||
slug: string;
|
||||
/** 阅读时长(分钟,取整,最少 1) */
|
||||
readingMinutes: number;
|
||||
}
|
||||
|
||||
/** 详情页使用的完整文章 */
|
||||
export interface Post extends PostMeta {
|
||||
/** Markdown / MDX 正文(未编译) */
|
||||
content: string;
|
||||
}
|
||||
Reference in new issue
Block a user