mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-02-05 16:33:08 +00:00
refactor: extract docs to standalone site at autoforge.cc
- Remove embedded documentation system (18 files) from main UI:
- Delete ui/src/components/docs/ (DocsPage, DocsContent, DocsSidebar,
DocsSearch, docsData, and all 13 section components)
- Delete ui/src/hooks/useHashRoute.ts (only used for docs routing)
- Simplify ui/src/main.tsx: remove Router component, render App directly
inside QueryClientProvider (no more hash-based routing)
- Update docs button in App.tsx header to open https://autoforge.cc in
a new tab instead of navigating to #/docs hash route
- Add logo to header
- Add temp-docs/ to .gitignore
- Update CLAUDE.md with current architecture documentation
The documentation has been extracted into a separate repository and
deployed as a standalone Vite + React site at https://autoforge.cc.
This reduces the main UI bundle and decouples docs from app releases.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
import { useState, useEffect, useCallback } from 'react'
|
||||
|
||||
export type Route = 'app' | 'docs'
|
||||
|
||||
interface HashRouteState {
|
||||
route: Route
|
||||
section: string | null
|
||||
navigate: (hash: string) => void
|
||||
}
|
||||
|
||||
function parseHash(hash: string): { route: Route; section: string | null } {
|
||||
const cleaned = hash.replace(/^#\/?/, '')
|
||||
if (cleaned === 'docs' || cleaned.startsWith('docs/')) {
|
||||
const section = cleaned.slice(5) || null // Remove 'docs/' prefix
|
||||
return { route: 'docs', section }
|
||||
}
|
||||
return { route: 'app', section: null }
|
||||
}
|
||||
|
||||
export function useHashRoute(): HashRouteState {
|
||||
const [state, setState] = useState(() => parseHash(window.location.hash))
|
||||
|
||||
useEffect(() => {
|
||||
const handleHashChange = () => {
|
||||
setState(parseHash(window.location.hash))
|
||||
}
|
||||
window.addEventListener('hashchange', handleHashChange)
|
||||
return () => window.removeEventListener('hashchange', handleHashChange)
|
||||
}, [])
|
||||
|
||||
const navigate = useCallback((hash: string) => {
|
||||
window.location.hash = hash
|
||||
}, [])
|
||||
|
||||
return { ...state, navigate }
|
||||
}
|
||||
Reference in New Issue
Block a user