mirror of https://github.com/coder/coder.git
feat: expose docs URL via static meta (#8594)
This commit is contained in:
parent
517fb19474
commit
164672e5d3
|
@ -310,6 +310,7 @@ func New(options *Options) *API {
|
|||
Database: options.Database,
|
||||
SiteFS: site.FS(),
|
||||
OAuth2Configs: oauthConfigs,
|
||||
DocsURL: options.DeploymentValues.DocsURL.String(),
|
||||
})
|
||||
staticHandler.Experiments.Store(&experiments)
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<meta property="appearance" content="{{ .Appearance }}" />
|
||||
<meta property="experiments" content="{{ .Experiments }}" />
|
||||
<meta property="regions" content="{{ .Regions }}" />
|
||||
<meta property="docs-url" content="{{ .DocsURL }}" />
|
||||
<!-- We need to set data-react-helmet to be able to override it in the workspace page -->
|
||||
<link
|
||||
rel="alternate icon"
|
||||
|
|
|
@ -66,6 +66,7 @@ type Options struct {
|
|||
Database database.Store
|
||||
SiteFS fs.FS
|
||||
OAuth2Configs *httpmw.OAuth2Configs
|
||||
DocsURL string
|
||||
}
|
||||
|
||||
func New(opts *Options) *Handler {
|
||||
|
@ -167,6 +168,7 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|||
// Token is the CSRF token for the given request
|
||||
CSRF: csrfState{Token: nosurf.Token(r)},
|
||||
BuildInfo: h.buildInfoJSON,
|
||||
DocsURL: h.opts.DocsURL,
|
||||
}
|
||||
|
||||
// First check if it's a file we have in our templates
|
||||
|
@ -236,6 +238,7 @@ type htmlState struct {
|
|||
Appearance string
|
||||
Experiments string
|
||||
Regions string
|
||||
DocsURL string
|
||||
}
|
||||
|
||||
type csrfState struct {
|
||||
|
|
Loading…
Reference in New Issue