refactor: overhaul Docusaurus command and generation

- Rework `hero docusaurus` command to use local `cfg` files
- Scan and export doctree collections during site generation
- Fix `baseUrl` redirect path handling in `index.tsx`
- Add cycle detection for `play.include` in playbooks
- Improve site config processing to prevent duplicate items
This commit is contained in:
Mahmoud-Emad
2025-08-07 10:46:57 +03:00
parent 2667856633
commit 82a46e8149
15 changed files with 291 additions and 140 deletions

View File

@@ -14,6 +14,13 @@ pub mut:
pub fn new(args FactoryArgs) !&Site {
name := texttools.name_fix(args.name)
// Check if a site with this name already exists
if name in websites {
// Return the existing site instead of creating a new one
return get(name: name)!
}
websites[name] = &Site{
siteconfig: SiteConfig{
name: name
@@ -40,3 +47,8 @@ pub fn default() !&Site {
}
return get()!
}
// list returns all site names that have been created
pub fn list() []string {
return websites.keys()
}