We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59ed841 commit 9f2b609Copy full SHA for 9f2b609
packages/tools/docs-tools/src/data/authors.json
packages/tools/docs-tools/src/remarkFrontmatterToProps.ts
@@ -1,6 +1,6 @@
1
import { compareDesc } from 'date-fns';
2
+import { join } from 'path';
3
import yaml from 'js-yaml';
-import authors from './data/authors.json';
4
import type {
5
DocsRootContent,
6
IAuthorInfo,
@@ -68,9 +68,14 @@ const getBlogAuthorInfo = async (
68
const authorId = data.authorId;
69
if (!authorId) return;
70
71
+ const authorFilePath = join(process.cwd(), 'src/data/authors.json');
72
+
73
+ const authors = await import(authorFilePath);
74
75
const author = (authors as IAuthorInfo[]).find(
76
(author) => author.id === authorId,
77
);
78
79
if (!author) return;
80
81
author.posts = await getLatestBlogPostsOfAuthor(author);
0 commit comments