This commit is contained in:
2025-08-13 09:35:58 +02:00
parent 75363d7aeb
commit 55f0621983
2 changed files with 17 additions and 2 deletions

View File

@@ -50,6 +50,21 @@ pub fn (mut s DocSite) build_publish() ! {
'
retry: 0
)!
for item in s.website.siteconfig.build_dest {
if item.path.trim_space().trim("/ ") == "" {
$if debug{
print_backtrace()
}
return error("build destination path is empty for docusaurus.")
}
osal.exec(
cmd: '
cd ${s.path_build.path}
rsync -avz --delete -e "ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" build/ ${item.path}
'
)!
}
}
@[params]

View File

@@ -16,7 +16,7 @@ pub fn dsite_define(sitename string) ! {
mut c := config()!
path_publish := '${c.path_publish.path}/${sitename}'
path_build_ := '${c.path_build.path}/${sitename}'
path_build_ := '${c.path_build.path}'
// Get the site object after processing, this is the website which is a generic definition of a site
mut website := site.get(name: sitename)!
@@ -24,7 +24,7 @@ pub fn dsite_define(sitename string) ! {
// Create the DocSite instance
mut dsite := &DocSite{
name: sitename
path_publish: pathlib.get_dir(path: path_publish, create: true)!
path_publish: pathlib.get_dir(path: "${path_build_}/build", create: true)!
path_build: pathlib.get_dir(path: path_build_, create: true)!
config: new_configuration(website.siteconfig)!
website: website