mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-17 18:22:37 +02:00
feat(blog): add LastUpdateAuthor & LastUpdateTime (#9912)
Co-authored-by: OzakIOne <OzakIOne@users.noreply.github.com> Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
parent
7938803747
commit
c745021b01
40 changed files with 833 additions and 359 deletions
|
@ -26,6 +26,7 @@ import {
|
|||
getContentPathList,
|
||||
isUnlisted,
|
||||
isDraft,
|
||||
readLastUpdateData,
|
||||
} from '@docusaurus/utils';
|
||||
import {validateBlogPostFrontMatter} from './frontMatter';
|
||||
import {type AuthorsMap, getAuthorsMap, getBlogPostAuthors} from './authors';
|
||||
|
@ -231,6 +232,12 @@ async function processBlogSourceFile(
|
|||
|
||||
const aliasedSource = aliasedSitePath(blogSourceAbsolute, siteDir);
|
||||
|
||||
const lastUpdate = await readLastUpdateData(
|
||||
blogSourceAbsolute,
|
||||
options,
|
||||
frontMatter.last_update,
|
||||
);
|
||||
|
||||
const draft = isDraft({frontMatter});
|
||||
const unlisted = isUnlisted({frontMatter});
|
||||
|
||||
|
@ -337,6 +344,8 @@ async function processBlogSourceFile(
|
|||
authors,
|
||||
frontMatter,
|
||||
unlisted,
|
||||
lastUpdatedAt: lastUpdate.lastUpdatedAt,
|
||||
lastUpdatedBy: lastUpdate.lastUpdatedBy,
|
||||
},
|
||||
content,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue