Compare commits

..

2 Commits

Author SHA1 Message Date
299f6dea06 bump version to 1.0.13 2025-02-10 15:53:30 +03:00
ed025f9acb ... 2025-02-10 15:53:06 +03:00
6 changed files with 43 additions and 14 deletions

View File

@@ -51,7 +51,7 @@ fn do() ! {
mut cmd := Command{
name: 'hero'
description: 'Your HERO toolset.'
version: '1.0.12'
version: '1.0.13'
}
// herocmds.cmd_run_add_flags(mut cmd)

View File

@@ -4,7 +4,7 @@ set -e
os_name="$(uname -s)"
arch_name="$(uname -m)"
version='1.0.12'
version='1.0.13'
# Base URL for GitHub releases

View File

@@ -42,8 +42,8 @@ pub mut:
base_url string @[json: 'baseUrl']
image string
metadata MainMetadata
build_dest string @[json: 'buildDest']
build_dest_dev string @[json: 'buildDestDev']
build_dest []string @[json: 'buildDest']
build_dest_dev []string @[json: 'buildDestDev']
}
// Navbar config structures
@@ -80,8 +80,37 @@ pub fn load_config(cfg_dir string) !Config {
footer := json.decode(Footer, footer_content)!
// Load and parse main config
main_content := os.read_file(os.join_path(cfg_dir, 'main.json'))!
main := json.decode(Main, main_content)!
main_config_path := os.join_path(cfg_dir, 'main.json')
main_content := os.read_file(main_config_path)!
main := json.decode(Main, main_content) or {
eprintln("${main_config_path} is not in the right format please fix.")
println('
## EXAMPLE OF A GOOD ONE:
- note the list for buildDest and buildDestDev
- note its the full path where the html is pushed too
{
"title": "ThreeFold Web4",
"tagline": "ThreeFold Web4",
"favicon": "img/favicon.png",
"url": "https://docs.threefold.io",
"url_home": "docs/introduction",
"baseUrl": "/",
"image": "img/tf_graph.png",
"metadata": {
"description": "ThreeFold is laying the foundation for a geo aware Web 4, the next generation of the Internet.",
"image": "https://threefold.info/kristof/img/tf_graph.png",
"title": "ThreeFold Docs"
},
"buildDest":["root@info.ourworld.tf:/root/hero/www/info/tfgrid4"],
"buildDestDev":["root@info.ourworld.tf:/root/hero/www/infodev/tfgrid4"]
}
')
exit(99)
}
// Load and parse navbar config
navbar_content := os.read_file(os.join_path(cfg_dir, 'navbar.json'))!

View File

@@ -55,9 +55,6 @@ pub fn (mut f DocusaurusFactory) build(args_ DSiteNewArgs) !&DocSite {
pub fn (mut f DocusaurusFactory) build_dev_publish(args_ DSiteNewArgs) !&DocSite {
mut s := f.add(args_)!
s.generate()!
if s.config.main.build_dest_dev == ""{
return error("build_dest_dev not specified, can't build publish.")
}
osal.exec(
cmd: '
cd ${s.path_build.path}
@@ -72,9 +69,6 @@ pub fn (mut f DocusaurusFactory) build_publish(args_ DSiteNewArgs) !&DocSite {
mut s := f.add(args_)!
s.generate()!
if s.config.main.build_dest == ""{
return error("build_dest not specified, can't build publish.")
}
osal.exec(
cmd: '
@@ -228,6 +222,7 @@ pub fn (mut site DocSite) error(args ErrorArgs) {
pub fn (mut site DocSite) generate() ! {
console.print_header(' site generate: ${site.name} on ${site.path_build.path}')
console.print_header(' site source on ${site.path_src.path}')
site.template_install()!
// osal.exec(
// cmd: '
@@ -313,4 +308,5 @@ fn (mut site DocSite) template_install() ! {
build2_.template_write(build, true)!
build2_.chmod(0o700)!
}

View File

@@ -18,4 +18,6 @@ ${profile_include}
bun docusaurus build
rsync -rv --delete ${site.path_build.path}/build/ ${cfg.main.build_dest.trim_right("/")}/${cfg.main.name.trim_right("/")}/
@for dest in cfg.main.build_dest_dev
rsync -rv --delete ${site.path_build.path}/build/ ${dest.trim_right("/")}/
@end

View File

@@ -17,4 +17,6 @@ ${profile_include}
bun docusaurus build
rsync -rv --delete ${site.path_build.path}/build/ ${cfg.main.build_dest.trim_right("/")}/${cfg.main.name.trim_right("/")}/
@for dest in cfg.main.build_dest
rsync -rv --delete ${site.path_build.path}/build/ ${dest.trim_right("/")}/
@end