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

issue的Label有长度限制!把id留空可能导致 Error: Validation Failed #112

Open
LinXueyuanStdio opened this issue Feb 1, 2018 · 5 comments

Comments

@LinXueyuanStdio
Copy link

详情看我文章

@xjzsq
Copy link

xjzsq commented Feb 7, 2018

解决label长度限制问题的一个方法:http://www.xjdesyxx.top/2018/02/07/errsln/

liweiwei1419 added a commit to liweiwei1419/blog that referenced this issue Feb 8, 2018
gitment 评论不能初始化的解决方案:
这个 issues 页面下面有两篇文章,都是解决方案:
imsun/gitment#112
@iHTCboy
Copy link

iHTCboy commented Feb 25, 2018

出现 Error:validation failed

我想到一个更好的方法,用文章的时间,这样长度是保证在50个字符内,完美解决!
id: '<%= page.date %>'

具体原因可以查看我博客:http://ihtc.cc/2018/02/25/2018-02-25%20_Gitment评论功能接入踩坑教程/

@YummyLau
Copy link

YummyLau commented Mar 2, 2018

在 themes\next\layout_third-party\comments 目录下修改gitments.swig,找到以下代码修改

      function renderGitment(){
        var gitment = new {{CommentsClass}}({
-           id: window.location.pathname,
+           id: '{{ page.date }}',
            owner: '{{ theme.gitment.github_user }}',
            repo: '{{ theme.gitment.github_repo }}',
            {% if theme.gitment.mint %}
            lang: "{{ theme.gitment.language }}" || navigator.language || navigator.systemLanguage || navigator.userLanguage,
            {% endif %}

之后重新hexo g -d就ok了,请保证没有浏览器缓存。

@xumeng
Copy link

xumeng commented May 10, 2018

我的博客列举了几种解决办法,我的是使用批量初始化的脚本实现的。
http://amonxu.com/2018/05/10/Hello-Gitment/
有兴趣可参考下。

@kobe1941
Copy link

id: '{{ page.date }}',
对Octopress的博客可以用,
但是id: '<%= page.date %>'则对Octopress的博客无效。

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

No branches or pull requests

6 participants