We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eebf6d7 commit 10f209aCopy full SHA for 10f209a
layouts/_shortcodes/discourse.html
@@ -6,12 +6,16 @@
6
</style>
7
8
{{ $token := .Site.Params.discourseToken }}
9
+{{ if ne $token nil }}
10
+ {{ warnf "Using Params.discourseToken is not recommended. Use HUGO_DISCOURSE_TOKEN instead." }}
11
+{{ end }}
12
+
13
{{ if ne (getenv "HUGO_DISCOURSE_TOKEN") "" }}
14
{{ $token = getenv "HUGO_DISCOURSE_TOKEN" }}
15
{{ end }}
16
17
{{ $opts := dict
-"headers" (dict "Api-Key" .Site.Params.discourseToken "Api-Username" "system") }}
18
+"headers" (dict "Api-Key" $token "Api-Username" "system") }}
19
20
{{ $data := dict }}
21
{{ $responde := resources.GetRemote (print (.Get 0) ".json") $opts}}
0 commit comments