Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

opencollective/hexo-deployer-git

 
 

Repository files navigation

hexo-deployer-git

Build Status NPM version Coverage Status Build status

Git deployer plugin for Hexo.

Installation

$ npm install hexo-deployer-git --save

Options

You can configure this plugin in _config.yml.

# You can use this:
deploy:
  type: git
  repo: <repository url>
  branch: [branch]
  message: [message]
  name: [git user]
  email: [git email]
  extend_dirs: [extend directory]
  ignore_hidden: false # default is true

# or this:
deploy:
  type: git
  message: [message]
  repo:
    github: <repository url>,[branch]
    coding: <repository url>,[branch]
  extend_dirs:
    - [extend directory]
    - [another extend directory]
  ignore_hidden:
    public: false
    [extend directory]: true
    [another extend directory]: false
  • repo: Repository URL
  • branch: Git branch to deploy the static site to
  • message: Commit message. The default commit message is Site updated: {{ now('YYYY-MM-DD HH:mm:ss') }}.
  • name and email: User info for committing the change, overrides global config. This info is independent of git login.
  • extend_dirs: Add some extensions directory to publish. e.g demo, examples
  • ignore_hidden (Boolean|Object): whether ignore hidden files to publish. the github requires the .nojekyll in root.
    • Boolean: for all dirs.
    • Object: for public dir and extend dir:
      • public: the public dir defaults.
      • [extend directory]

How it works

hexo-deployer-git works by generating the site in .deploy_git and force pushing to the repo(es) in config. If .deploy_git does not exist, a repo will initialized (git init). Otherwise the curent repo (with its commit history) will be used.

Users can clone the deployed repo to .deploy_git to keep the commit history.

git clone <gh-pages repo> .deploy_git

Reset

Remove .deploy_git folder.

$ rm -rf .deploy_git

License

MIT

About

Git deployer plugin for Hexo.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages

  • JavaScript 100.0%