ATQQ / sugar-blog

✍️📚我写博客的地方🤪🤪🤪记录随笔与学习笔记,仓库包含:博客内容,博客主题、博客模板、vitepress离线全文搜索插件、VitePress RSS 支持插件;a blog theme use vitepress
https://sugarat.top
MIT License
330 stars 61 forks source link

fix(rss): support git submodule #252

Closed northword closed 2 months ago

northword commented 2 months ago

获取 Git 时间时,进入工作目录再运行 git,这样可以获取到 submodule 中的文件的时间,可以与 VitePress 原生的保持一致:https://github.com/vuejs/vitepress/blob/8fef47848bd3418014b06eea1337b1e66e0473c6/src/node/utils/getGitTimestamp.ts#L12-L17

其他类似的写法: VitePress-Plugin-Git-Changelog: https://github.com/nolebase/integrations/blob/f400cdf43f782744ed05a783f51208ec07fd800d/packages/vitepress-plugin-git-changelog/src/vite/helpers.ts#L224-L251

ATQQ commented 2 months ago

可以的,之前也是看了VitePress实现,可能没注意到这个细节。

那个判断目录是否存在的判断是否有存在的必要?

ATQQ commented 2 months ago

vitepress-plugin-rss@0.2.8