diff --git a/docs/product/docs.json b/docs/product/docs.json index 30a9016006..854fbc911e 100644 --- a/docs/product/docs.json +++ b/docs/product/docs.json @@ -6,7 +6,13 @@ "primary": "#999999" }, "contextual": { - "options": ["copy", "view", "chatgpt", "claude", "perplexity"] + "options": [ + "copy", + "view", + "chatgpt", + "claude", + "perplexity" + ] }, "favicon": "/unkey.png", "fonts": { @@ -55,7 +61,11 @@ "groups": [ { "group": "Getting Started", - "pages": ["introduction", "quickstart/quickstart", "glossary"] + "pages": [ + "introduction", + "quickstart/quickstart", + "glossary" + ] }, { "group": "Framework Guides", @@ -197,7 +207,10 @@ { "group": "Audit Logs", "icon": "scroll", - "pages": ["audit-log/introduction", "audit-log/types"] + "pages": [ + "audit-log/introduction", + "audit-log/types" + ] }, { "group": "Security", @@ -236,7 +249,10 @@ { "group": "Migrations", "icon": "arrows-rotate", - "pages": ["migrations/introduction", "migrations/keys"] + "pages": [ + "migrations/introduction", + "migrations/keys" + ] }, { "group": "Errors", @@ -410,11 +426,17 @@ }, { "group": "Go", - "pages": ["libraries/go/overview", "libraries/go/api"] + "pages": [ + "libraries/go/overview", + "libraries/go/api" + ] }, { "group": "Python", - "pages": ["libraries/py/overview", "libraries/py/api"] + "pages": [ + "libraries/py/overview", + "libraries/py/api" + ] } ] }, @@ -423,7 +445,9 @@ "pages": [ { "group": "Nuxt", - "pages": ["libraries/nuxt/overview"] + "pages": [ + "libraries/nuxt/overview" + ] } ] } @@ -507,4 +531,4 @@ } ], "theme": "maple" -} +} \ No newline at end of file diff --git a/pkg/codes/generate.go b/pkg/codes/generate.go index 780309f9bd..874bc6cc34 100644 --- a/pkg/codes/generate.go +++ b/pkg/codes/generate.go @@ -221,7 +221,10 @@ func processCategory(f *os.File, systemName, domainName, categoryName, domain st } // Write the constant - f.WriteString(fmt.Sprintf("\t%s URN = \"%s\"\n", constName, codeStr)) + _, err := fmt.Fprintf(f, "\t%s URN = \"%s\"\n", constName, codeStr) + if err != nil { + panic(err) + } // Store error code info for MDX generation errorCodes = append(errorCodes, ErrorCodeInfo{ @@ -238,7 +241,7 @@ func processCategory(f *os.File, systemName, domainName, categoryName, domain st // generateMissingMDXFiles creates MDX documentation files for error codes that don't have them func generateMissingMDXFiles(errorCodes []ErrorCodeInfo) error { // Get the base docs directory path (relative to this file) - baseDocsPath := filepath.Join("..", "..", "..", "apps", "docs", "errors") + baseDocsPath := filepath.Join("..", "..", "..", "docs", "product", "errors") created := 0 skipped := 0 @@ -304,7 +307,7 @@ description: "%s" // removeObsoleteMDXFiles deletes MDX files that don't have corresponding error codes func removeObsoleteMDXFiles(errorCodes []ErrorCodeInfo) error { - baseDocsPath := filepath.Join("..", "..", "..", "apps", "docs", "errors") + baseDocsPath := filepath.Join("..", "..", "..", "docs", "product", "errors") // Build a set of valid file paths from error codes validPaths := make(map[string]bool) @@ -370,7 +373,7 @@ func removeObsoleteMDXFiles(errorCodes []ErrorCodeInfo) error { // updateDocsJSON updates the docs.json navigation to include all error pages func updateDocsJSON(errorCodes []ErrorCodeInfo) error { - docsJSONPath := filepath.Join("..", "..", "web", "apps", "docs", "docs.json") + docsJSONPath := filepath.Join("..", "..", "docs", "product", "docs.json") // Read existing docs.json data, err := os.ReadFile(docsJSONPath)