facebook / facebook/docusaurus

Last updated: feeding data through front matter, new "created" metadata

Offen
#5,691 24 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
domain: content plugin feature good first issue
Vorherrschende Sprache
TypeScript
Sterne
66.2k
Forks
10k
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
52

Beschreibung

## 🚀 Feature

Two things:

- A new "created" metadata (using git history)
- Allow manually feeding the "last updated" / "created" data in front matter when git history is not available / is messed up (e.g. #5598)

### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues)?

Yes

### Has this been requested on [Canny](https://docusaurus.io/feature-requests)?

Requested multiple times on Discord

## Motivation

The "created" metadata can be used to differentiate between "new" pages and "deprecated" pages. "Last updated" shouldn't be entirely relying on git history since that can be buggy sometimes.

## API Design

Front matter options:

```ts
last_update_time: Date | string
last_update_author: string
create_time: Date | string
create_author: string
```

New config options `showCreateTime` and `showCreateAuthor`

The implementation of "create time" shouldn't be too hard with git, but it can also be messed up in versioning, so🤷‍♂️ Front matter metadata FTW

## Have you tried building it?

No

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.