• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xcatliu
V2EX  ›  程序员

撸了两个 Hexo 的 Plugins

  •  
  •   xcatliu ·
    xcatliu · Jul 1, 2016 · 6561 views
    This topic created in 3642 days ago, the information mentioned may be changed or developed.

    都是从 git log 获取数据填充到 posts 中:

    hexo-filter-date-from-git

    • 获取 post 的第一个提交的 date 作为 front-matter 中的 date
    • 获取 post 的最后一个提交的 date 作为 front-matter 中的 updated

    解决的问题

    hexo 中如果没有在 front-matter 中指定 date,则会读取文件的创建日期和修改日期。 但是这个日期是不可靠的。如果重新 clone 一份代码,则所有文件的创建日期都变成了 clone 的时间。

    hexo-filter-author-from-git

    • 获取 post 的第一个提交的 user.name 作为 author
    • 获取 post 的所有提交的 user.name ,生成一个数组作为 contributors

    解决的问题

    手动维护一个 contributors 列表太麻烦了。

    1 replies    2016-07-01 19:14:12 +08:00
    jrhu05
        1
    jrhu05  
       Jul 1, 2016 via iPhone
    bravo !有 hexo 专门节点哦,可以放到 hexo 节点。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5632 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 08:53 · PVG 16:53 · LAX 01:53 · JFK 04:53
    ♥ Do have faith in what you're doing.