docusaurus fixes and correct hero cli implementation
This commit is contained in:
@@ -58,6 +58,13 @@ pub fn (mut s DocSite) build_publish() ! {
|
||||
)!
|
||||
}
|
||||
|
||||
pub fn (mut s DocSite) open() ! {
|
||||
// Print instructions for user
|
||||
console.print_item('open browser: ${s.url}')
|
||||
osal.exec(cmd: 'open https://localhost:3000')!
|
||||
}
|
||||
|
||||
|
||||
pub fn (mut s DocSite) dev() ! {
|
||||
s.clean()!
|
||||
s.generate()!
|
||||
@@ -76,8 +83,9 @@ pub fn (mut s DocSite) dev() ! {
|
||||
)!
|
||||
|
||||
// Send commands to the screen session
|
||||
console.print_item('To view the server output:: cd ${s.path_build.path}')
|
||||
scr.cmd_send('cd ${s.path_build.path}')!
|
||||
scr.cmd_send('bash develop.sh')!
|
||||
scr.cmd_send('bun start')!
|
||||
|
||||
// Print instructions for user
|
||||
console.print_header(' Docusaurus Development Server')
|
||||
@@ -98,6 +106,10 @@ pub fn (mut s DocSite) dev() ! {
|
||||
// tf.wait()!
|
||||
println('\n')
|
||||
|
||||
if s.args.open {
|
||||
s.open()!
|
||||
}
|
||||
|
||||
if s.args.watch_changes {
|
||||
docs_path := '${s.path_src.path}/docs'
|
||||
watch_docs(docs_path, s.path_src.path, s.path_build.path)!
|
||||
@@ -208,7 +220,7 @@ fn (mut site DocSite) process_md(mut path pathlib.Path, args MyImport) ! {
|
||||
fn (mut site DocSite) template_install() ! {
|
||||
mut gs := gittools.new()!
|
||||
|
||||
site.factory.template_install(template_update: false, install: false, delete: false)!
|
||||
site.factory.template_install(template_update: false, install: true, delete: false)!
|
||||
|
||||
cfg := site.config
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ pub mut:
|
||||
production bool
|
||||
watch_changes bool = true
|
||||
update bool
|
||||
open bool
|
||||
init bool // means create new one if needed
|
||||
deploykey string
|
||||
config ?Config
|
||||
|
||||
@@ -11,7 +11,7 @@ import time
|
||||
@[params]
|
||||
struct TemplateInstallArgs {
|
||||
template_update bool = true
|
||||
install bool
|
||||
install bool = true
|
||||
delete bool = true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user