You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Last updated: feeding data through front matter, new "created" metadata #5691
domain: content pluginRelated to content plugin emitting metadata for theme consumptionfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.
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.
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.
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
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: ...
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.
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.
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.
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?
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.
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.
domain: content pluginRelated to content plugin emitting metadata for theme consumptionfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.
Activity
slorber commentedon Oct 12, 2021
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.Josh-Cena commentedon Oct 22, 2021
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 defaultJosh-Cena commentedon Apr 29, 2022
@slorber proposed in #7263 a similar API:
I think that makes sense as well. We can possibly add other data in this namespace. Maybe we can even extend it to a
historyAPI if people want the last few revisions? (See #6218)Josh-Cena commentedon Apr 29, 2022
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.dpang314 commentedon May 18, 2022
I would like to work on this. Should I implement the history or only the last update?
Josh-Cena commentedon May 18, 2022
@dpang314 Let's start with a back-compatible
lastUpdatefirst.dpang314 commentedon May 18, 2022
Will do.
slorber commentedon Jun 17, 2022
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.
7 remaining items
SumairSoomro commentedon Feb 21, 2026
yourkarma6788 commentedon Mar 7, 2026
yourkarma6788 commentedon Mar 7, 2026
chengyixu commentedon Mar 20, 2026
Hi! I'd like to tackle this.
Approach: I'll add support for two things: (1) a
createdfront matter field that manually sets the creation date, mirroring howlast_updatefront matter already works; (2) a git-basedcreatedmetadata extraction usinggit log --follow --diff-filter=Ato get the first commit date for a file. Thedocusaurus-plugin-content-docsanddocusaurus-plugin-content-blogpackages would expose this asmetadata.createdAtfor 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
khuloud0 commentedon Mar 25, 2026
Hi, I'm a SE student. Is this issue still open for contributions? If so, I'd like to work on it.
Thakkar-Khushang commentedon Mar 29, 2026
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.
q404365631 commentedon Apr 26, 2026
I'll work on fixing the last updated date when feeding data through front matter. Please assign it to me.
Rajith-14 commentedon May 21, 2026
I'd like to work on this. Planning to implement the last_update front matter override (author + date) in the docs plugin.
derinbarutcu17 commentedon Jun 5, 2026
Hi Docusaurus team! I'd like to implement the
createdfrontmatter field. Looking at the existinglast_updatedimplementation inpackages/docusaurus-plugin-content-docs/src/, my plan is to mirror that pattern: readcreatedfrom the frontmatter schema, expose it on theDocMetadatatype, 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?HelloItsJustin commentedon Jun 10, 2026
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.
slorber commentedon Jun 18, 2026
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.
akshitj11 commentedon Jul 6, 2026
Fixed in #12230