docs: fix broken links (#16179)

Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>
Co-authored-by: Cian Johnston <cian@coder.com>
This commit is contained in:
Edward Angert
2025-01-17 13:18:48 -05:00
committed by GitHub
co-authored by EdwardAngert Cian Johnston
parent f34e6fd92c
commit 4f438e71cf
6 changed files with 46 additions and 30 deletions
+3 -3
View File
@@ -79,7 +79,7 @@ func (m Message) String() string {
return sb.String()
}
// URL returns a link to the admin/healthcheck docs page for the given Message.
// URL returns a link to the admin/monitoring/health-check docs page for the given Message.
// NOTE: if using a custom docs URL, specify base.
func (m Message) URL(base string) string {
var codeAnchor string
@@ -91,11 +91,11 @@ func (m Message) URL(base string) string {
if base == "" {
base = docsURLDefault
return fmt.Sprintf("%s/admin/healthcheck#%s", base, codeAnchor)
return fmt.Sprintf("%s/admin/monitoring/health-check#%s", base, codeAnchor)
}
// We don't assume that custom docs URLs are versioned.
return fmt.Sprintf("%s/admin/healthcheck#%s", base, codeAnchor)
return fmt.Sprintf("%s/admin/monitoring/health-check#%s", base, codeAnchor)
}
// Code is a stable identifier used to link to documentation.
+3 -3
View File
@@ -17,9 +17,9 @@ func Test_MessageURL(t *testing.T) {
base string
expected string
}{
{"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"},
{"empty", "", "", "https://coder.com/docs/admin/monitoring/health-check#eunknown"},
{"default", health.CodeAccessURLFetch, "", "https://coder.com/docs/admin/monitoring/health-check#eacs03"},
{"custom docs base", health.CodeAccessURLFetch, "https://example.com/docs", "https://example.com/docs/admin/monitoring/health-check#eacs03"},
} {
tt := tt
t.Run(tt.name, func(t *testing.T) {