Skip to content

Commit 10f209a

Browse files
committed
fix: Use local
1 parent eebf6d7 commit 10f209a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

layouts/_shortcodes/discourse.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
</style>
77

88
{{ $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+
913
{{ if ne (getenv "HUGO_DISCOURSE_TOKEN") "" }}
1014
{{ $token = getenv "HUGO_DISCOURSE_TOKEN" }}
1115
{{ end }}
1216

1317
{{ $opts := dict
14-
"headers" (dict "Api-Key" .Site.Params.discourseToken "Api-Username" "system") }}
18+
"headers" (dict "Api-Key" $token "Api-Username" "system") }}
1519

1620
{{ $data := dict }}
1721
{{ $responde := resources.GetRemote (print (.Get 0) ".json") $opts}}

0 commit comments

Comments
 (0)