From 35bb634f9d85532dcfb155cb8be39be3b48f7265 Mon Sep 17 00:00:00 2001 From: XPoet Date: Thu, 5 Jan 2023 11:36:38 +0800 Subject: [PATCH] feat(config): gitalk comments plugin add proxy configuration (#189) --- _config.yml | 1 + layout/_partial/comment/gitalk.ejs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 96d84bf..416109c 100644 --- a/_config.yml +++ b/_config.yml @@ -234,6 +234,7 @@ comment: repository: # Repository name to store issues client_id: # GitHub Application Client ID client_secret: # GitHub Application Client Secret + proxy: # GitHub oauth request reverse proxy for CORS # Twikoo # See: https://github.com/imaegoo/twikoo diff --git a/layout/_partial/comment/gitalk.ejs b/layout/_partial/comment/gitalk.ejs index 746a42b..a26c746 100644 --- a/layout/_partial/comment/gitalk.ejs +++ b/layout/_partial/comment/gitalk.ejs @@ -5,7 +5,8 @@ const { client_secret, repository, github_id, - github_admins + github_admins, + proxy } = theme.comment?.gitalk let cdn_css = '//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.css' let cdn_js = '//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.js' @@ -46,6 +47,7 @@ if (t_cdn_enable === true) { owner: '<%= github_id %>', admin: '<%= github_admins || [github_id] %>', id: __gitalk__pathname, + proxy: '<%= proxy %>', language: '<%= config.language %>' }).render('gitalk-container'); } catch (e) {