mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
✨ Feat: Add a custom domain setting option for Giscus, configured at params.page.comment.giscus.origin
This commit is contained in:
+1
-1
@@ -854,7 +854,7 @@ class FixIt {
|
||||
const giscusConfig = this.config.comment.giscus;
|
||||
this._giscusOnSwitchTheme = this._giscusOnSwitchTheme || (() => {
|
||||
const message = { setConfig: { theme: this.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme }};
|
||||
document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
||||
document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, giscusConfig.origin);
|
||||
});
|
||||
this.switchThemeEventSet.add(this._giscusOnSwitchTheme);
|
||||
this.giscus2parentMsg = window.addEventListener('message', (event) => {
|
||||
|
||||
@@ -1109,6 +1109,7 @@ enableEmoji = true
|
||||
category = ""
|
||||
categoryId = ""
|
||||
mapping = ""
|
||||
origin = "https://giscus.app" # Or set it to your self-hosted domain
|
||||
strict = "0" # FixIt NEW | 0.2.18
|
||||
term = ""
|
||||
reactionsEnabled = "1"
|
||||
|
||||
@@ -299,11 +299,12 @@
|
||||
{{- $giscus := $comment.giscus | default dict -}}
|
||||
{{- if $giscus.enable -}}
|
||||
{{- with $giscus -}}
|
||||
{{- $commentConfig = .origin | default "https://giscus.app" | dict "origin" | dict "giscus" | merge $commentConfig -}}
|
||||
{{- $commentConfig = .lightTheme | default "light" | dict "lightTheme" | dict "giscus" | merge $commentConfig -}}
|
||||
{{- $commentConfig = .darkTheme | default "dark" | dict "darkTheme" | dict "giscus" | merge $commentConfig -}}
|
||||
<div id="giscus" class="comment">
|
||||
<script
|
||||
src="https://giscus.app/client.js"
|
||||
src="{{ .Origin }}/client.js"
|
||||
data-repo="{{ .Repo }}"
|
||||
data-repo-id="{{ .RepoId }}"
|
||||
data-category="{{ .Category }}"
|
||||
|
||||
Reference in New Issue
Block a user