Selaa lähdekoodia

feat: add option to use self hosted Commento

If you are using the Commento cloud service, you do not need to
change anything, but if you want to use a self hosted instance, you can now
 provide the base url to your Commento instance.

Close #1446
Florian Pöhler 5 vuotta sitten
vanhempi
commit
bba41637a0

+ 5 - 0
exampleSite/config/_default/params.toml

@@ -212,6 +212,11 @@ plugins_js  = []
     shortname = ""  # Paste the shortname from your Disqus dashboard.
     show_count = true  # Show comment count in page header? (true/false)
 
+  # Configuration of Commento.
+  [comments.commento]
+    # If self-hosting Commento, enter its URL here (e.g. "https://commento.?.com"), otherwise leave empty.
+    url = ""
+
 ############################
 ## Search
 ############################

+ 2 - 1
layouts/partials/comments/commento.html

@@ -1,2 +1,3 @@
 <div id="commento"></div>
-<script src="https://cdn.commento.io/js/commento.js" defer></script>
+{{ $url := (printf "%s/js/commento.js" (site.Params.comments.commento.url | default "https://cdn.commento.io")) }}
+<script src="{{$url}}" defer></script>