Skip to content

Commit 164672e

Browse files
authored
feat: expose docs URL via static meta (#8594)
1 parent 517fb19 commit 164672e

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

coderd/coderd.go

+1
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ func New(options *Options) *API {
310310
Database: options.Database,
311311
SiteFS: site.FS(),
312312
OAuth2Configs: oauthConfigs,
313+
DocsURL: options.DeploymentValues.DocsURL.String(),
313314
})
314315
staticHandler.Experiments.Store(&experiments)
315316

site/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<meta property="appearance" content="{{ .Appearance }}" />
2222
<meta property="experiments" content="{{ .Experiments }}" />
2323
<meta property="regions" content="{{ .Regions }}" />
24+
<meta property="docs-url" content="{{ .DocsURL }}" />
2425
<!-- We need to set data-react-helmet to be able to override it in the workspace page -->
2526
<link
2627
rel="alternate icon"

site/site.go

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ type Options struct {
6666
Database database.Store
6767
SiteFS fs.FS
6868
OAuth2Configs *httpmw.OAuth2Configs
69+
DocsURL string
6970
}
7071

7172
func New(opts *Options) *Handler {
@@ -167,6 +168,7 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
167168
// Token is the CSRF token for the given request
168169
CSRF: csrfState{Token: nosurf.Token(r)},
169170
BuildInfo: h.buildInfoJSON,
171+
DocsURL: h.opts.DocsURL,
170172
}
171173

172174
// First check if it's a file we have in our templates
@@ -236,6 +238,7 @@ type htmlState struct {
236238
Appearance string
237239
Experiments string
238240
Regions string
241+
DocsURL string
239242
}
240243

241244
type csrfState struct {

0 commit comments

Comments
 (0)