Compare commits

...

5 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
c4ea066927 bump version to 1.0.12 2025-02-10 12:43:27 +03:00
5f9c6ff2bb ... 2025-02-10 12:41:14 +03:00
8965f7ae89 bump version to 1.0.10 2025-02-10 12:08:03 +03:00
10 changed files with 50 additions and 21 deletions

View File

@@ -51,7 +51,7 @@ fn do() ! {
mut cmd := Command{
name: 'hero'
description: 'Your HERO toolset.'
version: '1.0.9'
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.9'
version='1.0.13'
# Base URL for GitHub releases

View File

@@ -88,7 +88,7 @@ pub fn get(args_ GitStructureArgGet) !&GitStructure {
if cfg.coderoot != "SKIP"{
gs.config_ = cfg
gs.config_save()!
println(gs.config()!)
//println(gs.config()!)
}
gs.config()! // will load the config, don't remove

View File

@@ -22,7 +22,7 @@ fn installed() !bool {
if r.len != 1 {
return error("couldn't parse bun version.\n${res.output}")
}
println(' ${texttools.version(version)} <= ${texttools.version(r[0])}')
// println(' ${texttools.version(version)} <= ${texttools.version(r[0])}')
if texttools.version(version) <= texttools.version(r[0]) {
return true
}

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

@@ -2,8 +2,8 @@
set -ex
script_dir="??(cd "??(dirname "??{BASH_SOURCE[0]}")" && pwd)"
cd "??{script_dir}"
script_dir="???cd "???dirname "??{BASH_SOURCE[0]}")" && pwd)"
cd "???script_dir}"
echo "Docs directory: ??script_dir"

View File

@@ -2,7 +2,7 @@
set -e
script_dir="??(cd "??(dirname "??{BASH_SOURCE[0]}")" && pwd)"
script_dir="???cd "???dirname "??{BASH_SOURCE[0]}")" && pwd)"
cd "??{script_dir}"
@@ -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

@@ -2,7 +2,7 @@
set -ex
script_dir="??(cd "??(dirname "??{BASH_SOURCE[0]}")" && pwd)"
script_dir="???cd "???dirname "??{BASH_SOURCE[0]}")" && pwd)"
cd "??{script_dir}"
echo "Docs directory: ??script_dir"
@@ -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

View File

@@ -2,7 +2,7 @@
set -e
script_dir="??(cd "??(dirname "??{BASH_SOURCE[0]}")" && pwd)"
script_dir="???cd "???dirname "??{BASH_SOURCE[0]}")" && pwd)"
cd "??{script_dir}"
echo "Docs directory: ??script_dir"