GithubHelp home page GithubHelp logo

isabella232 / vuepress-plugin-git-log Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vuepress/vuepress-plugin-git-log

0.0 0.0 0.0 4 KB

๐Ÿ’พ Integrates git logs into VuePress.

Home Page: https://vuepress.github.io/plugins/git-log

License: MIT License

JavaScript 100.00%

vuepress-plugin-git-log's Introduction

vuepress-plugin-git-log

npm

A VuePress plugin that integrates git logs into your page.

Usage

Global Installation

npm install -g vuepress-plugin-git-log
# OR
yarn global add vuepress-plugin-git-log

Local Installation

npm install vuepress-plugin-git-log
# OR
yarn add vuepress-plugin-git-log

Add to config.js

module.exports = {
  plugins: [
    ['git-log', {
      additionalArgs: '--no-merge',
      onlyFirstAndLastCommit: true,
    }],
  ]
}

or

module.exports = {
  plugins: {
    'git-log': {
      additionalProps: {
        subject: '%s',
        authorEmail: '%ae',
      },
    },
  }
}

API

This plugin will add a git property to $page, with the following properties:

git.author

The author of the article, i.e. the author of the first commit.

git.created

The time the article was created, i.e. the authoring time of the first commit.

git.updated

The time the article was updated, i.e. the committing time of the last commit.

git.commits

A list of all the commits in chronological order.

git.contributors

A list of contributors to all users who have modified the article.

Configurations

formatTime

  • type: (timestamp: number, lang: string) => string
  • default: (timestamp, lang) => new Date(timestamp).toLocaleString(lang)

A function used to format Unix time.

additionalProps

  • type: { [prop: string]: string }
  • default: {}

An object that represents additional properties. Every key is a property name and value is the corresponding placeholder.

additionalArgs

  • type: string | string[]
  • default: []

A list of additional parameters to pass in.

extendGitLog

  • type: (git: object) => void
  • default: undefined

A function used to extend or modify the $page.git object.

onlyFirstAndLastCommit

  • type: boolean
  • default: false

Whether to search for only the first and last commit. Set this option to true for large-scale projects may optimize the initial startup performance. However, you will not be able to use $page.git.commits and $page.git.contributors as a cost.

vuepress-plugin-git-log's People

Contributors

shigma avatar

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.