All Projects → hexojs → Hexo Deployer Git

hexojs / Hexo Deployer Git

Licence: mit
Git deployer plugin for Hexo.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Hexo Deployer Git

Hexo Theme Edinburgh
Beautiful minimal portfolio theme for Hexo.
Stars: ✭ 289 (-31.19%)
Mutual labels:  hexo
Hexo Theme Clean Blog
Hexo implementation of Clean Blog http://blackrockdigital.github.io/startbootstrap-clean-blog/index.html
Stars: ✭ 362 (-13.81%)
Mutual labels:  hexo
Hexo Theme Aircloud
A concise hexo theme
Stars: ✭ 394 (-6.19%)
Mutual labels:  hexo
Hexo Theme Gal
忧郁的弟弟网站主题移植
Stars: ✭ 307 (-26.9%)
Mutual labels:  hexo
Hexo Matery Modified
My personal modified hexo matery theme with some bugs fixed.
Stars: ✭ 342 (-18.57%)
Mutual labels:  hexo
Hexo Theme Ocean
Ocean is a mobile-enabled Hexo theme based on the features in Hexo's default theme landscape.
Stars: ✭ 370 (-11.9%)
Mutual labels:  hexo
Hexo Douban
💿 A simple plugin for hexo that helps us generate pages for douban books ,movies and games.
Stars: ✭ 277 (-34.05%)
Mutual labels:  hexo
Hexo Theme Material
Material Design theme for hexo.
Stars: ✭ 4,028 (+859.05%)
Mutual labels:  hexo
Hexo Theme Hiker
An attractive theme for Hexo. called "Hiker", short for "HikerNews".
Stars: ✭ 348 (-17.14%)
Mutual labels:  hexo
Hexo Theme Claudia
📌 Concisely designed & easy to config, match device dark mode, 90+ Lighthouse scoring
Stars: ✭ 379 (-9.76%)
Mutual labels:  hexo
Hexo Theme Stun
🦄 An elegant theme for Hexo
Stars: ✭ 305 (-27.38%)
Mutual labels:  hexo
Hexo Generator Search
A plugin to generate search data for Hexo.
Stars: ✭ 318 (-24.29%)
Mutual labels:  hexo
Theme Bmw
✋ Smart Voice: Voice for yourself | 微声: 请为自己发声
Stars: ✭ 373 (-11.19%)
Mutual labels:  hexo
Hexo Theme Polarbear
A super light and simple theme.
Stars: ✭ 301 (-28.33%)
Mutual labels:  hexo
Blog
🎯 个人博客
Stars: ✭ 394 (-6.19%)
Mutual labels:  hexo
Hexo Theme Next
Elegant theme for Hexo.
Stars: ✭ 15,736 (+3646.67%)
Mutual labels:  hexo
Hexo Theme Typography
Rediscover the beauty of typography.
Stars: ✭ 367 (-12.62%)
Mutual labels:  hexo
Hexo Theme 3 Hexo
hexo主题:三段式设计、极简、方便 Hexo theme: three-stage design
Stars: ✭ 421 (+0.24%)
Mutual labels:  hexo
Hexo Generator Feed
Feed generator for Hexo.
Stars: ✭ 400 (-4.76%)
Mutual labels:  hexo
Hexo Theme Freemind
Most powerful bootstrap theme for hexo.
Stars: ✭ 376 (-10.48%)
Mutual labels:  hexo

hexo-deployer-git

Build Status NPM version Coverage Status Build status

Git deployer plugin for Hexo.

Notice: Fatal HttpRequestException Error on pushing to GitHub?

Update Git for Windows to the latest version. (Details)

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]
  token: ''
  message: [message]
  name: [git user]
  email: [git email]
  extend_dirs: [extend directory]
  ignore_hidden: false # default is true
  ignore_pattern: regexp  # whatever file that matches the regexp will be ignored when deploying

# or this:
deploy:
  type: git
  message: [message]
  repo: <repository url>[,branch]
  extend_dirs:
    - [extend directory]
    - [another extend directory]
  ignore_hidden:
    public: false
    [extend directory]: true
    [another extend directory]: false
  ignore_pattern:
    [folder]: regexp  # or you could specify the ignore_pattern under a certain directory

# Multiple repositories
deploy:
  repo:
    # Either syntax is supported
    [repo_name]: <repository url>[,branch]
    [repo_name]:
      url: <repository url>
      branch: [branch]
  • repo: Repository settings, or plain url of your repo
    • url: Url of your repositury to pull from and push to.
    • branch: Optional git branch to deploy the static site to.
      • Defaults to gh-pages on GitHub.
      • Defaults to coding-pages on Coding.net.
      • Otherwise defaults to master.
    • token: Optional token value to authenticate with the repo. Prefix with $ to read token from environment variable (recommended). Repo must be a http(s) url. More details.
    • repo_name: Unique name when deploying to multiple repositories.
      • Example:
      deploy:
        repo:
          # Either syntax is supported
          github: https://github.com/user/project.git,branch
          gitee:
            url: https://gitee.com/user/project.git
            branch: branch_name
      
  • branch: Git branch to deploy the static site to. Branch name specified in repo: takes priority.
  • message: Commit message. Defaults to 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: Additional directories to publish. e.g demo, examples
  • ignore_hidden (Boolean|Object): whether ignore hidden files to publish. GitHub requires the .nojekyll in root.
    • Boolean: for all dirs.
    • Object: for public dir and extend dir:
      • public: the public dir defaults.
      • [extend directory]
  • ignore_pattern (Object|RegExp): Choose the ignore pattern when deploying
    • RegExp: for all dirs.
    • Object: specify the ignore pattern under certain directory. For example, if you want to push the source files and generated files at the same time to two different branches. The option should be like
    # _config.yaml
    deploy:
      - type: git
        repo: [email protected]:<username>/<username>.github.io.git
        branch: master
      - type: git
        repo: [email protected]:<username>/<username>.github.io.git
        branch: src
        extend_dirs: /
        ignore_hidden: false
        ignore_pattern:
            public: .
    

Deploy with token

While this plugin can parse authentication token from the config, only use this method if you are sure the config will not be committed, including to a private repo. A more secure approach is to add it to the CI as an environment variable, then simply add the name of the environment variable to this plugin's config (e.g. $GITHUB_TOKEN).

Additional guides:

  • Create a GitHub Personal Access Token. [Link]
  • Add authentication token to Travis CI. [Link]

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].