Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Git plugin: add createTime #45

Closed
Mister-Hope opened this issue Jan 31, 2021 · 2 comments
Closed

[Feature request] Git plugin: add createTime #45

Mister-Hope opened this issue Jan 31, 2021 · 2 comments
Labels

Comments

@Mister-Hope
Copy link
Member

Mister-Hope commented Jan 31, 2021

Feature request

I saw V2 add a date field in frontmatter in here:

https://github.com/vuepress/vuepress-next/blob/55f780c4a516b2c0119328874906647af80ac73b/packages/%40vuepress/plugin-git/src/types.ts#L5-L15

And add a date field in page:

https://github.com/vuepress/vuepress-next/blob/55f780c4a516b2c0119328874906647af80ac73b/packages/%40vuepress/core/src/types/page.ts#L100-L105

Theme and plugin builders may want to fetch the page date and use it.
The date can also be infered from git log, but git plugin currently support only updatedTime and contributors.

https://github.com/vuepress/vuepress-next/blob/55f780c4a516b2c0119328874906647af80ac73b/packages/%40vuepress/plugin-git/src/types.ts#L5-L15

I think adding a new field called createTime(first commit) would be better for theme and plugin builders to fetch the page date from git as a improvement instead of letting users fill in.

@meteorlxy
Copy link
Member

I also considered to add that, but I'm not sure if it's really useful:

  1. The time of first commit might not be the publish time of an article.
  2. Blog users may prefer to put date in filename / directory name ? (Not sure about that)

@meteorlxy
Copy link
Member

But as a plugin, providing this feature makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants