Giter Site home page Giter Site logo

hexo-generator-issues's Introduction

hexo-generator-issues

中文文档

This plugin publishes articles to github specified repository, and each article as an issue.

install

npm install hexo-generator-issues@beta --save

run

The plugin takes effect in the process of executing generate, that is, when the hexo g or hexo generate is executed, the publish progress will execute.

hexo generate 
// or
hexo g

After the release, the plugin will generate a _issue_generator_record' file in the blog directory. this file records the contents of the current release, please do not delete this file. this will ensure the next publish only publish the smallest changes, or the next publish will re-publish all the articles. This will cost a lot of time to publish your articles.

Configuration

Add the following content in your configuration file (_config.yml):

issues:
  # github certification, when submit the issue used it
  auth:
    # Authentication type, more authentication information goto:https://github.com/mikedeboer/node-github#authentication
    type: 
    # Use token authentication to provide token
    token: 
    # Use client keys authentication to provide id and secret
    id:
    secret: 
    # Use credentials to provide username and password
    username:
    password:

  # Provide a repository that needs to be placed issues
  repository:
    owner:  # github username
    repo: # Specifies the repository under the user name, and the repository must exist

  # In the issue to increase the original address of the blog reference, the corresponding address is post.permalink
  sourceLink: 
    # blog address information at the beginning (`top`, default) or end (` bottom`), 
    # use other values ​​to ignore the configuration
    position: 'top' 
    # The original message format, the default is `The default template is 'The original: $$url.**`, 
    # $$url`  is the placeholder for the url of the blog,corresponding to markdown: `[${post.title}](${post.permalink})`
    template: 'The original: $$url.**`. `$$url' 

The original configuration issueLink is temporarily deleted and will be re-enabled in later version.

Note, the issueNumber metadata parameters are no longer effective, no longer work:

---
title: The post's title
...
issueNumber: 1 //this line no longer work
...
---

Test

// todo

Problem

Publish slow

Requests that create content which triggers notifications, such as issues, comments and pull requests, may be further limited and will not include a Retry-After header in the response. Please create this content at a reasonable pace to avoid further limiting.

Since the interface provided by github limits the rate when the issue was created (moew info see: [dealing-with-abuse-rate-limits] (https://developer.github.com/v3/guides/best-practices-for-integrators/ # dealing-with-abuse-rate-limits). So the time interval for creating the issue is set to 2000 ms, which results in a very slow execution of the task when create many issues, and may also occur as follows problem:

HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=utf-8
Connection: close

{
  "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.",
  "documentation_url": "https://developer.github.com/v3#abuse-rate-limits"
}

In this case, you can re-execute the command at a later time.

For more information, see: [octokit/octokit.net#638] (octokit/octokit.net#638)

If necessary, you can modify the CREATE_ISSUE_INTERVAL release rate for the node_modules/hexo-generator-issues/dist/generator file.

More problem

If there are other questions or feedback, please come to tcatche/hexo-generator-issues.

Update

Rewrites a new version, optimizes the publishing logic, caches the history, and ensures that the next release is faster.

The current version is the beta version, which is not stable. The issues on github can not be deleted,so you should not use it in any important repos.

License

MIT

hexo-generator-issues's People

Contributors

tcatche avatar

Watchers

 avatar  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.