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

如何根据访问者地理位置选择性加载插件,对于来自中国的用户不加载某些被屏蔽的插件比如Disquz #1712

Open
3 tasks done
p1slave opened this issue Jun 24, 2022 · 4 comments

Comments

@p1slave
Copy link

p1slave commented Jun 24, 2022

Issue Checklist

  • I am using the latest version of NexT.
  • I have read the relevant documents of Hexo and NexT.
  • I have reviewed the latest Roadmap on GitHub and searched for current issues, which does not help me.

Expected behavior

我在博客里用了buymecoffee,patreon还有使用了Disquz评论插件,这些在国内都是显示不出来的,因为js库直接被屏蔽了。有没有办法让中国的用户打开博客的时候不加载这些插件,而中国以外的地方加载这些插件。对前端也不是很熟悉,并且还是静态网站,知道的朋友麻烦告诉我一下如何实现这样的功能,谢谢!

@welcome
Copy link

welcome bot commented Jun 24, 2022

Thanks for opening this issue, maintainers will get back to you as soon as possible!

@stevenjoezhang
Copy link
Contributor

可以看一下这个 DisqusJS

hexo-theme-next/_config.yml

Lines 589 to 601 in b062274

# DisqusJS
# Alternative Disqus - Render comment component using Disqus API.
# Demo: https://suka.js.org/DisqusJS/
# For more information: https://github.com/SukkaW/DisqusJS
disqusjs:
enable: false
# API Endpoint of Disqus API (https://disqus.com/api/).
# Leave api empty if you are able to connect to Disqus API. Otherwise you need a reverse proxy for it.
# For example:
# api: https://disqus.skk.moe/disqus/
api:
apikey: # Register new application from https://disqus.com/api/applications/
shortname: # See: https://disqus.com/admin/settings/general/

@p1slave
Copy link
Author

p1slave commented Jun 27, 2022

非常感谢!没想到还有这样的操作来绕过墙,很值得借鉴,虽然我已经换成Isso了

@p1slave
Copy link
Author

p1slave commented Jun 27, 2022

@stevenjoezhang 顺便问一下为什么有两个不同的Hexo Next的仓库?是这边的停了换到新的那个仓库了吗?如果是的话这边的仓库应该注明一下deprecation吧

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

No branches or pull requests

2 participants