Skip to content

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

Description

@Josh-Cena

🚀 Feature

Two things:

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

Activity

  1. added
    feature
    status: needs triage
    on Oct 12, 2021
  2. slorber commented on Oct 12, 2021

    @slorber
    Collaborator

    Agree that using frontmatter options to override defaults is a good idea.

    With a createFrontMatter() option that I'd like to add, this would also allow users to provide their own code logic, eventually reading it from SVN/Mercurial/CMS/other systems.

  3. Josh-Cena commented on Oct 22, 2021

    @Josh-Cena
    CollaboratorAuthor

    I will probably build this feature myself after the createFrontMatter() landed, since then we can get rid of the hard-coded last updated generation method and just inject that as a default

  4. removed
    status: needs triage
    on Oct 29, 2021
  5. self-assigned this
    on Nov 10, 2021
  6. added
    domain: content plugin
    on Apr 29, 2022
  7. Josh-Cena commented on Apr 29, 2022

    @Josh-Cena
    CollaboratorAuthor

    @slorber proposed in #7263 a similar API:

    last_update:
      author: string
      date: string

    I think that makes sense as well. We can possibly add other data in this namespace. Maybe we can even extend it to a history API if people want the last few revisions? (See #6218)

    history:
      # First item: creation
      - author: ...
        date: ...
      - author: ...
        date: ...
      # Last item: last update
      - author: ...
        date: ...
  8. added
    good first issue
    on Apr 29, 2022
  9. Josh-Cena commented on Apr 29, 2022

    @Josh-Cena
    CollaboratorAuthor

    Now that createFrontMatter() is probably not coming through in the near future, we can implement this first, just without an automated way to fill it.

  10. dpang314 commented on May 18, 2022

    @dpang314
    Contributor

    I would like to work on this. Should I implement the history or only the last update?

  11. Josh-Cena commented on May 18, 2022

    @Josh-Cena
    CollaboratorAuthor

    @dpang314 Let's start with a back-compatible lastUpdate first.

  12. dpang314 commented on May 18, 2022

    @dpang314
    Contributor

    Will do.

  13. slorber commented on Jun 17, 2022

    @slorber
    Collaborator

    A new "created" metadata (using git history)

    The "created" metadata can be used to differentiate between "new" pages and "deprecated" pages.

    As we discussed on discord, I'm not sure to understand the use-case for this 🤪

    In any case, making it possible for users to access a "created" metadata might have some benefits, just not sure to understand yet how it would be used in practice.

  14. 7 remaining items

  15. SumairSoomro commented on Feb 21, 2026

    @SumairSoomro
  16. yourkarma6788 commented on Mar 7, 2026

    @yourkarma6788
  17. yourkarma6788 commented on Mar 7, 2026

    @yourkarma6788
  18. chengyixu commented on Mar 20, 2026

    @chengyixu

    Hi! I'd like to tackle this.

    Approach: I'll add support for two things: (1) a created front matter field that manually sets the creation date, mirroring how last_update front matter already works; (2) a git-based created metadata extraction using git log --follow --diff-filter=A to get the first commit date for a file. The docusaurus-plugin-content-docs and docusaurus-plugin-content-blog packages would expose this as metadata.createdAt for use in themes and custom components.
    Timeline: 2-3 days
    Background: Node.js/TypeScript developer, 35+ npm packages published. Familiar with the Docusaurus plugin architecture and git metadata patterns.

    Ready to start immediately. — @chengyixu

  19. khuloud0 commented on Mar 25, 2026

    @khuloud0

    Hi, I'm a SE student. Is this issue still open for contributions? If so, I'd like to work on it.

  20. Thakkar-Khushang commented on Mar 29, 2026

    @Thakkar-Khushang

    Hi! I'd like to take a stab at this. My plan:

    Add showCreateTime + showCreateAuthor plugin options (mirroring the existing showLastUpdateTime/showLastUpdateAuthor)
    Add a first_publish: front matter field (with author and date sub-keys, mirroring last_update:)
    Wire up vcs.getFileCreationInfo() in the docs plugin — the VCS layer already supports this (it's used in the blog plugin for publish dates), just not exposed in docs yet
    Expose createdAt and createdBy on DocMetadata

    I'll scope this PR to the data layer only and leave theme rendering (UI changes to EditMetaRow, LastUpdated) as a follow-up, unless the maintainers prefer to do it all in one shot. Happy to adjust based on feedback before I open the PR.

  21. q404365631 commented on Apr 26, 2026

    @q404365631

    I'll work on fixing the last updated date when feeding data through front matter. Please assign it to me.

  22. Rajith-14 commented on May 21, 2026

    @Rajith-14

    I'd like to work on this. Planning to implement the last_update front matter override (author + date) in the docs plugin.

  23. derinbarutcu17 commented on Jun 5, 2026

    @derinbarutcu17

    Hi Docusaurus team! I'd like to implement the created frontmatter field. Looking at the existing last_updated implementation in packages/docusaurus-plugin-content-docs/src/, my plan is to mirror that pattern: read created from the frontmatter schema, expose it on the DocMetadata type, and make it available in the doc theme components. I'll also add it to the frontmatter docs. Is this still open and does my approach sound right?

  24. HelloItsJustin commented on Jun 10, 2026

    @HelloItsJustin

    Hi, I'd like to work on this. I'll submit a PR implementing the create_time, create_author front matter fields and the showCreateTime / showCreateAuthor config options.

  25. slorber commented on Jun 18, 2026

    @slorber
    Collaborator

    Hey

    We received 6 PRs for this issue; most of them are probably AI-generated.

    Contributing to OSS this way doesn't make sense anymore if you just throw a prompt at the agent, are not ready to invest more time than that, and submit PRs for issues that already have PRs. Please all reconsider this behavior: it is not helpful and only wastes maintainers' time.

    For that reason, I had to remove the "status: accepting PR" to this issue, and will close all the PRs. Please don't submit another PR, it will be closed as well. I don't want to reward this "OSS spam" behavior, so I will issue my own PR when I have time to focus on this.

  26. akshitj11 commented on Jul 6, 2026

    @akshitj11

    Fixed in #12230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain: content pluginfeaturegood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions