This commit is contained in:
2025-07-19 16:19:21 +02:00
parent f53a1c3349
commit 555272eeb3
4 changed files with 20 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import freeflowuniverse.herolib.osal
import freeflowuniverse.herolib.ui.console
import freeflowuniverse.herolib.core.texttools.regext
import freeflowuniverse.herolib.data.doctree
import freeflowuniverse.herolib.web.sitegen
pub fn (mut site DocSite) generate() ! {
console.print_header(' site generate: ${site.name} on ${site.factory.path_build.path}')
@@ -48,12 +49,26 @@ pub fn (mut site DocSite) generate() ! {
mut aa := site.path_src.dir_get('docs')!
aa.copy(dest: '${site.factory.path_build.path}/docs', delete: true)!
//now we need to process the pages, call the sitegen module, which will look for statements like
// !!site.page sitename:'atest'
// path:"crazy/sub.md" position:1
// src:"marketplace_specs:tft_tfp_marketplace"
// title:"Just a Page"
// description:"A description not filled in"
// draft:1 hide_title:1
configpath:="${site.path_src.path}/cfg"
sitegen.play(heroscript_path: configpath)!
// sitegenpath := '${os.home_dir()}/hero/var/sitegen/${site.name}'
// if os.exists(sitegenpath) {
// panic("Sdsdsd:${sitegenpath}")
// }
site.process_imports()!
}
pub fn (mut site DocSite) process_imports() ! {
// this means we need to do doctree version
mut tree := doctree.new(name: 'site_${site.name}')!
mut gs := gittools.new()!
for item in site.siteconfig.imports {

View File

@@ -56,7 +56,7 @@ pub fn play(args_ PlayArgs) ! {
git_pull: git_pull
path_publish: p.get_default('path_publish', '')!
production: p.get_default_false('production')
watch_changes: p.get_default_true('watch_changes')
// watch_changes: p.get_default_true('watch_changes')
update: p.get_default_false('update')
open: p.get_default_false('open')
init: p.get_default_false('init')

View File

@@ -19,7 +19,7 @@ pub mut:
// new creates a new siteconfig and stores it in redis, or gets an existing one
pub fn new(mut tree &doctree.Tree, args SiteNewArgs) !SiteFactory {
pub fn new(tree &doctree.Tree, args SiteNewArgs) !SiteFactory {
mut path := args.path
if path == '' {
path = '${os.home_dir()}/hero/var/sitegen'

View File

@@ -8,7 +8,6 @@ import freeflowuniverse.herolib.data.doctree
@[params]
pub struct PlayArgs {
pub mut:
heroscript string
heroscript_path string
plbook ?PlayBook
@@ -41,7 +40,7 @@ pub fn play(args_ PlayArgs) ! {
// description:"A description not filled in"
// draft:1 hide_title:1
mut factory:=new(mut tree)!
mut factory:=new(tree)!
page_actions := plbook.find(filter: 'site.page')!
mut mypage:=Page{src:"",path:""}