mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
chore: update documentation links to the new format (#13797)
This commit is contained in:
committed by
GitHub
parent
2a297b073a
commit
0787de88a9
@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/coder/coder/v2/buildinfo"
|
||||
"github.com/coder/coder/v2/coderd/util/ptr"
|
||||
)
|
||||
|
||||
@ -49,7 +48,7 @@ const (
|
||||
|
||||
// Default docs URL
|
||||
var (
|
||||
docsURLDefault = "https://coder.com/docs/v2"
|
||||
docsURLDefault = "https://coder.com/docs"
|
||||
)
|
||||
|
||||
// @typescript-generate Severity
|
||||
@ -92,12 +91,7 @@ func (m Message) URL(base string) string {
|
||||
|
||||
if base == "" {
|
||||
base = docsURLDefault
|
||||
versionPath := buildinfo.Version()
|
||||
if buildinfo.IsDev() {
|
||||
// for development versions, just use latest
|
||||
versionPath = "latest"
|
||||
}
|
||||
return fmt.Sprintf("%s/%s/admin/healthcheck#%s", base, versionPath, codeAnchor)
|
||||
return fmt.Sprintf("%s/admin/healthcheck#%s", base, codeAnchor)
|
||||
}
|
||||
|
||||
// We don't assume that custom docs URLs are versioned.
|
||||
|
@ -17,8 +17,8 @@ func Test_MessageURL(t *testing.T) {
|
||||
base string
|
||||
expected string
|
||||
}{
|
||||
{"empty", "", "", "https://coder.com/docs/v2/latest/admin/healthcheck#eunknown"},
|
||||
{"default", health.CodeAccessURLFetch, "", "https://coder.com/docs/v2/latest/admin/healthcheck#eacs03"},
|
||||
{"empty", "", "", "https://coder.com/docs/admin/healthcheck#eunknown"},
|
||||
{"default", health.CodeAccessURLFetch, "", "https://coder.com/docs/admin/healthcheck#eacs03"},
|
||||
{"custom docs base", health.CodeAccessURLFetch, "https://example.com/docs", "https://example.com/docs/admin/healthcheck#eacs03"},
|
||||
} {
|
||||
tt := tt
|
||||
|
Reference in New Issue
Block a user