vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.01k stars 2.1k forks source link

`lastUpdated` Feature Seems Not Displaying Date on Server Deployment Without Git #4119

Closed shuizhutieniu closed 2 months ago

shuizhutieniu commented 2 months ago

I have enabled the lastUpdated feature, but the last updated date is not being displayed. I understand that the method you implemented to show the last updated date involves fetching the date of the last commit. However, my project is deployed on a server without a Git environment. Is there a solution to this issue?

brc-dd commented 2 months ago

No. lastUpdated needs git. You can write it in frontmatter too, but you'll need to manually update it every time you update the file.

shuizhutieniu commented 2 months ago

thank you

brc-dd commented 2 months ago

Are you not using git? (I mean outside your server?)

shuizhutieniu commented 2 months ago

Are you not using git? (I mean outside your server?)

I do. I have just created a dummy Git repository and after placing the code in it and making a commit, the last updated date is now displaying correctly.