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
I want the home page of my website to show the last time it was updated.
One idea I came up with was to use the createContentLoader API to get all the .md document information and then get the latest git commit time for each .md document. However, the createContentLoader API does not return lastUpdated information for the document.
I tried the cultivating method is given in this link #3515, probably because the document is a little bit more, I wrote my website speed obstruction for a long time and at some strange errors, And I felt that his method of getting the timestamp was a bit complicated and cumbersome, so I gave up using the method mentioned in this link.
I write a lot of documentation in vitepress, and frequently build, and then deploy to github pages. Sometimes I want to see if the deployment is complete by opening the homepage of the website to see the latest submission time, rather than clicking through the many layers to see my new article. But I never found a solution.
In the end, I couldn't think of a way to get it done. So I took a moment to ask questions here. I also created a new github repository https://github.com/keer-tea/vitepress-test for minimal recovery requirements (stackblitz link with the same code https://stackblitz.com/~/github.com/keer-tea/vitepress-test) to minimize the need for recovery. If you have any good way to do this, please let me know. Thank you very much, I think it is very meaningful.
Minimum recovery page:
code:
other:
I have seen several websites that will display the latest update time on the home page. Can vitepress achieve this? Not manually changing the display time on the home page, but automatically. Maybe you don't need git commit times to meet this requirement, but what are the other ways?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want the home page of my website to show the last time it was updated.
One idea I came up with was to use the
createContentLoader
API to get all the.md
document information and then get the latest git commit time for each.md
document. However, thecreateContentLoader
API does not return lastUpdated information for the document.I tried the cultivating method is given in this link #3515, probably because the document is a little bit more, I wrote my website speed obstruction for a long time and at some strange errors, And I felt that his method of getting the timestamp was a bit complicated and cumbersome, so I gave up using the method mentioned in this link.
I write a lot of documentation in vitepress, and frequently build, and then deploy to github pages. Sometimes I want to see if the deployment is complete by opening the homepage of the website to see the latest submission time, rather than clicking through the many layers to see my new article. But I never found a solution.
In the end, I couldn't think of a way to get it done. So I took a moment to ask questions here. I also created a new github repository https://github.com/keer-tea/vitepress-test for minimal recovery requirements (stackblitz link with the same code https://stackblitz.com/~/github.com/keer-tea/vitepress-test) to minimize the need for recovery. If you have any good way to do this, please let me know. Thank you very much, I think it is very meaningful.
Minimum recovery page:
code:
other:
I have seen several websites that will display the latest update time on the home page. Can vitepress achieve this? Not manually changing the display time on the home page, but automatically. Maybe you don't need git commit times to meet this requirement, but what are the other ways?
Beta Was this translation helpful? Give feedback.
All reactions