ciqulover / Disqus Proxy
Licence: mit
Hexo插件 解决国内不能访问 Disqus 的代理
Stars: ✭ 154
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Disqus Proxy
Disqusjs
💬 Render Disqus comments in Mainland China using Disqus API
Stars: ✭ 455 (+195.45%)
Mutual labels: hexo, disqus
Schnack
🗣️ Simple self-hosted node app for Disqus-like drop-in commenting on static websites
Stars: ✭ 1,729 (+1022.73%)
Mutual labels: disqus
Hexo Theme Amazing
Demo: https://removeif.github.io/removeif-demo hexo-theme
Stars: ✭ 154 (+0%)
Mutual labels: hexo
Hexo Theme Overdose
⚠ Caution: you could be overdosed with this theme.
Stars: ✭ 137 (-11.04%)
Mutual labels: hexo
Hexo Theme Lite
Keep Calm, Light and Writing. Light Hexo Theme.
Stars: ✭ 148 (-3.9%)
Mutual labels: hexo
Nice Knowledge System
📚不积跬步无以至千里,每天进步一点点,Passion,Self-regulation,Love and Share
Stars: ✭ 137 (-11.04%)
Mutual labels: hexo
Hexo Theme Lx
👉 A simple & clear & elegant Hexo theme. 🔭🔭Lx——一款简洁、美观的Hexo博客主题。
Stars: ✭ 144 (-6.49%)
Mutual labels: hexo
Hexo Theme Arknights
明日方舟罗德岛阵营的 Hexo 主题,支持数学公式、Valine评论系统、Mermaid图表
Stars: ✭ 154 (+0%)
Mutual labels: hexo
Hexo 插件,解决 disqus 不能访问的反向代理
Demo
准备
- 一台国外的VPS服务器
- 基本的命令行相关知识
- 一点点hexo的使用经验
安装
在Hexo
博客目录执行
npm install hexo-disqus-proxy --save
前端配置
在你的Hexo
博客目录中修改_config.yml
文件
添加如下配置:(注意缩进和空格)
disqus_proxy:
shortname: ciqu
username: ciqu
host: disqus-proxy.ycwalker.com
port: 443
其中:
-
shortname
是你的website的 shortname 名称 比如在你的disqus安装代码中 有这样一句脚本: s.src = 'https://test-eo9kkdlcze.disqus.com/embed.js'; 那么你的disqus 的shortname 就是 test-eo9kkdlcze -
username
是你的disqus用户名,即评论时候留下的名字,用来区别disqus-proxy的评论头像显示 -
host
是你启用disqus代理的VPS的域名 -
port
是VPS服务器启用disqus代理的端口,需要与之后配置的后端一致
关键的一步
在disqus
的官方配置中,我们需要在页面合适位置添加一个 <div id="disqus_thread"></div>
作为占位符,
而hexo-disqus-proxy
插件并不能知道在页面的哪个位置插入这个标签比较合适,所以这个需要额外配置一下:
情况一
如果你本身用的主题已经支持disqus
的配置,那么灰常爽,你只需要正常启用主题的disqus评论,插件就会自动检测并合适的覆盖,
这是最常见的情况,肯定是最吼的。
情况二
在你写的markdown
文件底部插入<div id="disqus_thread"></div>
。这样评论框位置会位于文章的下方,并且大小能被外部元素所约束,不会乱跑。
什么,markdown
也能插入HTML
标签?
嗯是的。
情况三
稍微懂一点点hexo
的基本知识,自己改主题。大概的思路是,在Hexo
渲染的过程中,把<div id="disqus_thread"></div>
加在主题目录下的layout目录中
关于博文页面的模板中的合适的位置就行了。
后端配置
1.3.0
版本之后将后端分离出来,查看这里进行配置
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].