Skip to content

Commit

Permalink
fix(gitalk): fix github issues label length limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrminfive committed Mar 7, 2018
1 parent 8de1264 commit c69f34a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion layout/_partial/common/comment.swig
Expand Up @@ -13,7 +13,7 @@
owner: '{{ config.gitTalk.owner }}',
admin: [{% for item in config.gitTalk.admin %}'{{ item }}', {% endfor %}],
labels: tags,
id: (Date.now()) > (new Date('2018-02-15')).getTime() ? md5(location.href) : location.href
id: (new Date({{ page.date }})).getTime() > (new Date('2018-02-15')).getTime() ? md5(location.href) : location.href
});

gitalk.render('comment-container');
Expand Down
16 changes: 16 additions & 0 deletions scripts/helper.js
Expand Up @@ -324,4 +324,20 @@ hexo.extend.helper.register('s_paginator', function(size = 2) {
</ul>
</nav>
`;
});

hexo.extend.helper.register('json', function(data) {
var cache = [];
return JSON.stringify(data, function (key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
// Circular reference found, discard key
return;
}
// Store value in our collection
cache.push(value);
}
return value;
});
cache = null;
});

0 comments on commit c69f34a

Please sign in to comment.