feat(content-docs): last_update front matter#7461
Merged
slorber merged 17 commits intofacebook:mainfrom Jun 1, 2022
Merged
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Josh-Cena
approved these changes
May 22, 2022
packages/docusaurus-plugin-content-docs/src/plugin-content-docs.d.ts
Outdated
Show resolved
Hide resolved
Josh-Cena
reviewed
May 23, 2022
packages/docusaurus-plugin-content-docs/src/plugin-content-docs.d.ts
Outdated
Show resolved
Hide resolved
Josh-Cena
requested changes
May 24, 2022
Collaborator
Josh-Cena
left a comment
There was a problem hiding this comment.
Almost there, well done!
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
slorber
reviewed
May 27, 2022
| let showedFileNotTrackedError = false; | ||
|
|
||
| export async function getFileLastUpdate( | ||
| export function getFileLastUpdate( |
Collaborator
There was a problem hiding this comment.
keep this async, we'll likely make getFileCommitDate async in the future
| last_update: Joi.object({ | ||
| author: Joi.string(), | ||
| date: Joi.date().raw(), | ||
| }), |
Collaborator
There was a problem hiding this comment.
do we allow empty last_update object? (no strong opinion, just curious to know what you think)
slorber
requested changes
May 27, 2022
Collaborator
slorber
left a comment
There was a problem hiding this comment.
Looks good overall 👍
Just small changes requested
packages/docusaurus-plugin-content-docs/src/__tests__/frontMatter.test.ts
Show resolved
Hide resolved
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-flight checklist
Motivation
This feature allows overriding Git history through front matter. It addresses part of #5691. It uses the API design mentioned here to be reused for created metadata and potentially a history.
Test Plan
Added unit tests for front matter configurations, including:
Created doc unit tests
Dogfooding
Test links
Deploy preview: https://deploy-preview-7461--docusaurus-2.netlify.app/
Dogfooding page: https://deploy-preview-7461--docusaurus-2.netlify.app/tests/docs/doc-with-last-update/
Documentation: https://deploy-preview-7461--docusaurus-2.netlify.app/docs/api/plugins/@docusaurus/plugin-content-docs/#markdown-front-matter
Related issues/PRs
#5691