ppoffice / hexo-theme-icarus

A simple, delicate, and modern theme for the static site generator Hexo.
https://ppoffice.github.io/hexo-theme-icarus/
MIT License
6.28k stars 1.54k forks source link

能否支持一下 giscus 评论 #1207

Closed 2-3-5-7 closed 1 year ago

2-3-5-7 commented 1 year ago

确保你在提交功能建议之前仔细阅读了Hexo文档Icarus用户指南,和GitHub issues来了解你的建议是否已经被他人提出过。

你的功能建议与某个使用问题相关么?请详述。

希望增加使用 giscus 作为评论,感谢!

2-3-5-7 commented 1 year ago

目前临时用 giscus 生成的代码,注释掉原代码 comment.jsx 文件

return <div class="card">
            <div class="card-content">
                { <h3 class="title is-5">{__('article.comments')}</h3>}
                <script src="https://giscus.app/client.js"
                        data-repo=""
                        data-repo-id="="
                        data-category="General"
                        data-category-id=""
                        data-mapping="pathname"
                        data-strict="0"
                        data-reactions-enabled="0"
                        data-emit-metadata="0"
                        data-input-position="bottom"
                        data-theme="light"
                        data-lang="zh-CN"
                        data-loading="lazy"
                        crossorigin="anonymous"
                        async>
                </script>
                {/*(() => {
                    try {
                        let Comment = view.require('comment/' + comment.type);
                        Comment = Comment.Cacheable ? Comment.Cacheable : Comment;
                        return <Comment config={config} page={page} helper={helper} comment={comment} />;
                    } catch (e) {
                        logger.w(`Icarus cannot load comment "${comment.type}"`);
                        return null;
                    }
                })()*/}
            </div>
        </div>;
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

quanru commented 1 year ago

试试这种方式: https://github.com/quanru/quanru.github.io/blob/main/scripts/inject.js#L8