...
This commit is contained in:
@@ -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',
|
||||
]
|
||||
)!
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user