All Projects → ciqulover → Disqus Proxy

ciqulover / Disqus Proxy

Licence: mit
Hexo插件 解决国内不能访问 Disqus 的代理

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
Neveryu.github.io
我的博客(Hexo + NexT + GitPage)
Stars: ✭ 150 (-2.6%)
Mutual labels:  hexo
Hexo Theme Vateral
😘hexo单页面主题:Vateral(a theme for hexo)
Stars: ✭ 133 (-13.64%)
Mutual labels:  hexo
Hexo Cli
Command line interface for Hexo
Stars: ✭ 141 (-8.44%)
Mutual labels:  hexo
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 Apollo
🌅 a concise hexo theme
Stars: ✭ 1,797 (+1066.88%)
Mutual labels:  hexo
Hexo Theme Zhaoo
🐳 A simple theme for Hexo
Stars: ✭ 131 (-14.94%)
Mutual labels:  hexo
Hexo Theme Amazing
Demo: https://removeif.github.io/removeif-demo hexo-theme
Stars: ✭ 154 (+0%)
Mutual labels:  hexo
Hexo Theme Xoxo
Hexo theme for https://blog.0xff000000.com
Stars: ✭ 149 (-3.25%)
Mutual labels:  hexo
Hexo Theme Anodyne
🌋 Original Bright Theme for Hexo
Stars: ✭ 140 (-9.09%)
Mutual labels:  hexo
Hexo Theme Overdose
⚠ Caution: you could be overdosed with this theme.
Stars: ✭ 137 (-11.04%)
Mutual labels:  hexo
Flex Block
一个基于Hexo的主题
Stars: ✭ 133 (-13.64%)
Mutual labels:  hexo
Hexo Theme Lite
Keep Calm, Light and Writing. Light Hexo Theme.
Stars: ✭ 148 (-3.9%)
Mutual labels:  hexo
Yinwang
Blog Theme For Hexo
Stars: ✭ 133 (-13.64%)
Mutual labels:  hexo
Hexo Wordcount
A Word Count Plugin for Hexo
Stars: ✭ 150 (-2.6%)
Mutual labels:  hexo
Fe Blog Repository
♻️ 🚀我的前端学习笔记仓库✨
Stars: ✭ 133 (-13.64%)
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 Aath
Hexo 主题
Stars: ✭ 154 (+0%)
Mutual labels:  hexo
Hexo Theme Arknights
明日方舟罗德岛阵营的 Hexo 主题,支持数学公式、Valine评论系统、Mermaid图表
Stars: ✭ 154 (+0%)
Mutual labels:  hexo

Hexo 插件,解决 disqus 不能访问的反向代理

npm package

NPM

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].