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

enhance the md file create time config ? #4491

Open
4 tasks done
igitinode opened this issue Jan 14, 2025 · 5 comments
Open
4 tasks done

enhance the md file create time config ? #4491

igitinode opened this issue Jan 14, 2025 · 5 comments

Comments

@igitinode
Copy link

Is your feature request related to a problem? Please describe.

add a "createTime" config for md file . like lastUpdated。 createTime: {text: "创建于",formatOptions: {...}}

Describe the solution you'd like

we can show my md file create time in the footer or header.

Describe alternatives you've considered

No response

Additional context

No response

Validations

@yuyinws
Copy link
Contributor

yuyinws commented Jan 15, 2025

There is already a lastUpdated option. You can checkout it here.

@brc-dd
Copy link
Member

brc-dd commented Jan 15, 2025

The OP probably is asking to support "Created at" datetime along side "Last updated".

@igitinode
Copy link
Author

The OP probably is asking to support "Created at" datetime along side "Last updated".

Yes, it is

@laplacetw
Copy link

For a simple workaround, I created a script to generate a new MD file with a template that includes the creation time.

@github-actions github-actions bot added the stale label Mar 2, 2025
@shellRaining
Copy link
Contributor

Across different operating systems or file systems, the behavior of birthtime is not very consistent, besides some editor may "change" birthtime too, such as vim, so maybe it's difficult to get the accurate create time, you can see below link

https://stackoverflow.com/questions/58263078/fs-stat-birthtime-birthtimems-in-linux-and-macos

vitepress now use git stamp to get last modified time

https://github.com/vuejs/vitepress/blob/main/src/node/utils/getGitTimestamp.ts

for more edit version info, you can see my repo

https://github.com/shellRaining/shellRaining-blog/blob/main/packages/theme/src/node/injectVersion.ts

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

No branches or pull requests

5 participants