Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions docs/product/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
"primary": "#999999"
},
"contextual": {
"options": ["copy", "view", "chatgpt", "claude", "perplexity"]
"options": [
"copy",
"view",
"chatgpt",
"claude",
"perplexity"
]
},
"favicon": "/unkey.png",
"fonts": {
Expand Down Expand Up @@ -55,7 +61,11 @@
"groups": [
{
"group": "Getting Started",
"pages": ["introduction", "quickstart/quickstart", "glossary"]
"pages": [
"introduction",
"quickstart/quickstart",
"glossary"
]
},
{
"group": "Framework Guides",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -236,7 +249,10 @@
{
"group": "Migrations",
"icon": "arrows-rotate",
"pages": ["migrations/introduction", "migrations/keys"]
"pages": [
"migrations/introduction",
"migrations/keys"
]
},
{
"group": "Errors",
Expand Down Expand Up @@ -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"
]
}
]
},
Expand All @@ -423,7 +445,9 @@
"pages": [
{
"group": "Nuxt",
"pages": ["libraries/nuxt/overview"]
"pages": [
"libraries/nuxt/overview"
]
}
]
}
Expand Down Expand Up @@ -507,4 +531,4 @@
}
],
"theme": "maple"
}
}
11 changes: 7 additions & 4 deletions pkg/codes/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading