Closed Shuaiqizheng closed 7 months ago
Please provide a reproducible example. Your project should be a git repo and you should've committed your files for it to work.
Please provide a reproducible example. Your project should be a git repo and you should've committed your files for it to work.
this is all my files : https://github.com/pdbsdk/no-lastUpdated Please help me, thank you!
It's showing fine 👀
Oh my god! In my computer's and phone's broswer, it is showing this. Do you also use vitepress v1.0.1 ?
It's showing fine 👀
Which version do you use ?
Yeah. I'm using 1.0.1. How are you building and previewing your project?
Can you verify if this command shows correct date for you:
git log -1 --pretty="%ai" "docs/no lastUpdated 1.md"
It should show you something like this:
Unbelievable! after our chat, without making any changes to my source files, everything suddenly started displaying correctly! However, this stroke of luck was limited to the demo project I shared with you. My actual website project still stubbornly refuses to display the update time, even after I've diligently copied over all the configurations from the demo. It wasn't until I executed the git command you provided that the light bulb went on. Turns out, the issue wasn't with the config file at all, but was sparked by the git repository path's mischievous hide-and-seek.The demo project eventually played nice because, in my eagerness to demonstrate the problem to you, I set the git repository path to 'C:\site'. On the other hand, the original project was throwing a tantrum because its git repository path was 'C:\site\docs.vitepress\dist'.Initially, my master plan was simply to upload the generated files; an oversight had the markdown source files lurking outside of git's watchful eye, rendering the update time display helpless.And the reason it 'magically' started working after our chat? Well, my git upload antics inadvertently waved a wand and fixed the issue. So there you have it, a heartfelt thank you is in order—you're my knight in shining code! Sending you a virtual high-five!
Describe the bug
lastUpdatedtime can't show in v1.0.1
related config.mts :
import { defineConfig } from 'vitepress'
export default defineConfig({ lastUpdated: true , themeConfig: { lastUpdated: { text: '最后更新于', formatOptions: { dateStyle: 'short', timeStyle: 'medium' } } } })
Reproduction
1
Expected behavior
Please fix it!
System Info
Additional context
No response
Validations