Giter Site home page Giter Site logo

hexo-update-time's Introduction

Hexo-update-time

配合 lint-staged, husky 插件自动在提交前自动更新 dateupdated 字段

安装依赖

npm install hexo-update-time lint-staged husky

执行

npx husky install

确保 git 钩子生效

执行

npx husky add .husky/pre-commit "npm run lint-staged"

添加 pre-commit 钩子

package.json 中添加 lint-stagedscript 和相应配置

{
  // ...
  "script": {
    // ...
    "lint-staged": "lint-staged"
  },
  "lint-staged": {
    "source/_posts/*.md": "hexo-update-time"
  }
}

如果为第一次提交,那么 dateupdated 会统一更新到当前时间

否则只有 updated 会更新到当前时间

hexo-update-time's People

Contributors

dedicatus546 avatar

Watchers

 avatar

Forkers

calfzhou

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.