facebook/Docusaurus

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

Open

#5,691 建立於 2021年10月12日

在 GitHub 查看
 (20 留言) (0 反應) (0 負責人)JavaScript (12,167 star) (1,074 fork)batch import
domain: content pluginfeaturegood first issuestatus: accepting pr

描述

🚀 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?

Yes

Has this been requested on Canny?

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:

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

貢獻者指南