This commit is contained in:
2025-08-08 15:53:25 +02:00
parent 6308d232aa
commit 682abdbda9
2 changed files with 35 additions and 0 deletions

View File

@@ -161,4 +161,38 @@ export default function Home() {
path: docs_path
site: updated_site
)!
site.process_imports()!
}
pub fn (mut site DocSite) process_imports() ! {
mut gs := gittools.new()!
mut f:=factory_get()!
for item in site.siteconfig.imports {
mypath := gs.get_path(
pull: false
reset: false
url: item.url
)!
mut mypatho := pathlib.get(mypath)
mypatho.copy(dest: '${f.path_build.path}/docs/${item.dest}', delete: true)!
// println(item)
// replace: {'NAME': 'MyName', 'URGENCY': 'red'}
mut ri := regext.regex_instructions_new()
for key, val in item.replace {
ri.add_item('\{${key}\}', val)!
}
mypatho.copy(dest: '${f.path_build.path}/docs/${item.dest}', delete: true)!
ri.replace_in_dir(
path: '${f.path_build.path}/docs/${item.dest}'
extensions: [
'md',
]
)!
}
}