Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gitalk that id was too long to create a issue tag. #664

Open
wants to merge 2 commits into
base: canary
Choose a base branch
from

Conversation

ElderJames
Copy link
Contributor

Contributing rules

  • Fork the repo and create your branch from canary. Then be sure to put the canary branch as the target for your pull request.
  • Please be sure to follow the contributing guidelines, especially for commit message
  • Remove the Contributing rules part from this description
  • Fill out the other parts from this description

If you don't do so, we might change your pull request's title and using squash to merge your changed.

What kind of change does this PR introduce? (check one with "x")

  • Bug fix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

Description

修复gitalk的id过长导致无法创建评论框的问题。


Verification steps

  • 设定在2018-03-01之后的评论框使用md5加密的pathname作为id,之前已创建的还使用明文
  • 这个时间之前的文章如果需要创建评论需要在文章头部加上gitalk:md5来强行使用md5
  • 这个时间之后的已创建的评论框需要需要在文章头部加上gitalk: plaintext来强行使用明文

@cntanglijun
Copy link
Contributor

@ElderJames 也可以使用原生 btoa base64 加密

var gitalk = new Gitalk({
        id: btoa(location.href).slice(0,32),
        clientID: '<%= theme.comment.gitalk_client_id %>',
        clientSecret: '<%= theme.comment.gitalk_client_secret %>',
        repo: '<%= theme.comment.gitalk_repo %>',
        owner: '<%= theme.comment.gitalk_owner %>',
        admin: ['<%= theme.comment.gitalk_owner %>'],
        // facebook-like distraction free mode
        distractionFreeMode: false
})

可以做一个 Gitalk 配置项,可以设置加密规则,加密后字符长度。:ghost:

@ElderJames
Copy link
Contributor Author

@cntanglijun 感谢建议。不过作者貌似不想合并这个pr 😭

@cubesky
Copy link
Collaborator

cubesky commented Nov 26, 2018

对不起 我现在无法联系其他的合作开发者,无法进行合并操作,我们会尽快进行合并

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants