This commit is contained in:
2025-05-04 08:19:47 +03:00
parent d8a59d0726
commit 46e1c6706c
177 changed files with 5708 additions and 5512 deletions

View File

@@ -14,7 +14,7 @@ pub mut:
sites []&DocSite @[skip; str: skip]
path_build pathlib.Path
// path_publish pathlib.Path
args DocusaurusArgs
args DocusaurusArgs
config Config // Stores configuration from HeroScript if provided
}
@@ -22,10 +22,10 @@ pub mut:
pub struct DocusaurusArgs {
pub mut:
// publish_path string
build_path string
production bool
update bool
heroscript string
build_path string
production bool
update bool
heroscript string
heroscript_path string
}
@@ -37,7 +37,7 @@ pub fn new(args_ DocusaurusArgs) !&DocusaurusFactory {
// if args.publish_path == ""{
// args.publish_path = "${os.home_dir()}/hero/var/docusaurus/publish"
// }
// Create the factory instance
mut ds := &DocusaurusFactory{
args: args_
@@ -48,21 +48,21 @@ pub fn new(args_ DocusaurusArgs) !&DocusaurusFactory {
// Process HeroScript
mut heroscript_text := args.heroscript
mut heroscript_path := args.heroscript_path
// If no heroscript is explicitly provided, check current directory
if heroscript_text == '' && heroscript_path == '' {
// First check if there's a .heroscript file in the current directory
current_dir := os.getwd()
cfg_dir := os.join_path(current_dir, 'cfg')
cfg_dir := os.join_path(current_dir, 'cfg')
if os.exists(cfg_dir) {
heroscript_path = cfg_dir
}
}
// Process any HeroScript that was found
if heroscript_text != '' || heroscript_path != '' {
ds.config = play(
heroscript: heroscript_text
heroscript: heroscript_text
heroscript_path: heroscript_path
)!
}