Skip to content

Commit

Permalink
fix: slug 缺失
Browse files Browse the repository at this point in the history
  • Loading branch information
YuJianghao committed Nov 12, 2021
1 parent 238fcca commit 6df9f32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/server/src/apps/hexo/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class Hexo implements IHexoAPI, IHexoCommand {
return docs.map((postDoc) => {
const post: BriefPost = {
...postDoc,
slug: postDoc.slug,
date: postDoc?.date.toString(),
updated: postDoc?.updated.toString(),
prev: postDoc?.prev?._id,
Expand All @@ -138,6 +139,7 @@ class Hexo implements IHexoAPI, IHexoCommand {
return docs.map((pageDoc) => {
const page: BriefPage = {
...pageDoc,
slug: pageDoc.slug,
date: pageDoc?.date.toString(),
updated: pageDoc?.updated.toString(),
prev: pageDoc?.prev?._id,
Expand Down
1 change: 1 addition & 0 deletions packages/server/src/apps/hexo/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface BriefArticle {
_id: string;
slug: string;
title: string;
date: string;
updated?: string | undefined;
Expand Down
1 change: 1 addition & 0 deletions packages/server/src/apps/hexo/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface Query<T> {

interface Article {
_id: string;
slug: string;
title: string;
date: number;
updated?: number | undefined;
Expand Down

0 comments on commit 6df9f32

Please sign in to comment.