jekyll-TeXt-theme icon indicating copy to clipboard operation
jekyll-TeXt-theme copied to clipboard

Feature request: custom proxy config for Gitalk to solve 403 error

Open biociao opened this issue 3 years ago • 2 comments

According to https://github.com/gitalk/gitalk/issues/433, new proxy is needed to solve CORS issue. Current theme version seems not available to config it.

Similar issue in another theme: https://github.com/auroral-ui/hexo-theme-aurora/issues/16

biociao avatar Jul 25 '21 04:07 biociao

Well, I've found a solution for myself:

  1. Add the following line next to /_config.yml#L131:
proxy: 'https://<your customized proxy url>'
  1. Add the following line next to /_includes/comments-providers/gitalk.html#L23:
{%- assign _proxy = _proxy | slice: 2, _last -%}
  1. And this line next to /_includes/comments-providers/gitalk.html#L33:
proxy: [{{ _proxy }}],
  1. Use the latest version of gitalk at L48 and L59 in /_data/variables.yml
gitalk:
  js: 'https://unpkg.com/gitalk@latest/dist/gitalk.min.js'
  css: 'https://unpkg.com/gitalk@latest/dist/gitalk.css'

Not perfect but it works now.

biociao avatar Jul 27 '21 02:07 biociao

Well, I've found a solution for myself:

  1. Add the following line next to /_config.yml#L131:
proxy: 'https://<your customized proxy url>'
  1. Add the following line next to /_includes/comments-providers/gitalk.html#L23:
{%- assign _proxy = _proxy | slice: 2, _last -%}
  1. And this line next to /_includes/comments-providers/gitalk.html#L33:
proxy: [{{ _proxy }}],
  1. Use the latest version of gitalk at L48 and L59 in /_data/variables.yml
gitalk:
  js: 'https://unpkg.com/gitalk@latest/dist/gitalk.min.js'
  css: 'https://unpkg.com/gitalk@latest/dist/gitalk.css'

Not perfect but it works now.

right now, just update the gitalk to the latest version, it sloved.

Babylonehy avatar Oct 22 '21 06:10 Babylonehy