refactor: Improve playbook processing and add generation

- Trigger doc content generation after playbook processing
- Remove mutable variables for playbook actions
- Eliminate `action.done = true` assignments
- Derive site name from title if not explicitly provided
- Separate local path and git URL for docusaurus sites
This commit is contained in:
Mahmoud-Emad
2025-08-05 17:47:33 +03:00
parent ccf2d4a3a5
commit a848eaa18b
3 changed files with 36 additions and 39 deletions

View File

@@ -12,13 +12,11 @@ import freeflowuniverse.herolib.core.texttools.regext
import freeflowuniverse.herolib.web.site as sitegen
pub fn (mut site DocSite) generate() ! {
mut f:=factory_get()!
mut f := factory_get()!
console.print_header(' site generate: ${site.name} on ${f.path_build.path}')
console.print_header(' site source on ${site.path_src.path}')
// lets make sure we remove the cfg dir so we rebuild
cfg_path := os.join_path(f.path_build.path, 'cfg')
osal.rm(cfg_path)!
@@ -72,6 +70,16 @@ pub fn (mut site DocSite) generate() ! {
mut plbook := playbook.new(path: configpath)!
sitegen.play(mut plbook)!
// Get the updated site object after processing
mut updated_site := sitegen.get(name: site.name)!
// Generate the actual docs content from the processed site configuration
docs_path := '${f.path_build.path}/docs'
generate(
path: docs_path
site: updated_site
)!
// site.process_imports()!
}