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