feat(content-docs): last_update front matter (#7461)

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
dpang314 2022-06-01 10:27:58 -04:00 committed by GitHub
parent a469ae3d63
commit 4f26a1911a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 499 additions and 36 deletions

View file

@ -281,6 +281,7 @@ Accepted fields:
| `slug` | `string` | File path | Allows to customize the document url (`/<routeBasePath>/<slug>`). Support multiple patterns: `slug: my-doc`, `slug: /my/path/myDoc`, `slug: /`. |
| `tags` | `Tag[]` | `undefined` | A list of strings or objects of two string fields `label` and `permalink` to tag to your docs. |
| `draft` | `boolean` | `false` | A boolean flag to indicate that a document is a work-in-progress. Draft documents will only be displayed during development. |
| `last_update` | `FileChange` | `undefined` | Allows overriding the last updated author and/or date. Date can be any [parsable date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). |
</APITable>
@ -288,6 +289,10 @@ Accepted fields:
type Tag = string | {label: string; permalink: string};
```
```ts
type FileChange = {date: string; author: string};
```
Example:
```md
@ -306,6 +311,9 @@ keywords:
- docusaurus
image: https://i.imgur.com/mErPwqL.png
slug: /myDoc
last_update:
date: 1/1/2000
author: custom author name
---
# Markdown Features