My personal knowledge base,also a blog,build with Nuxt,online url: https://www.lionad.art
thanks cmykpixels@codepen for beautiful backgrounds
使用 nuxt-content-git 模块自动从 Git 历史中提取文章的创建和更新时间:
- 创建时间 (
createdAt):首次提交的时间 - 更新时间 (
updatedAt):最后修改的时间
文章底部会自动显示时间戳组件,如果更新时间与创建时间相同,则只显示创建时间。
相关文件:
content.config.ts- 定义createdAt和updatedAt字段app/components/content/ArticleTimestamp.vue- 时间戳显示组件app/pages/[...slug].vue- 集成时间戳到文章页面
本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议进行许可。
如需转载部分内容,请邮件联系作者。
