alpha p2
This commit is contained in:
@@ -30,13 +30,15 @@ func Project(dir string) error {
|
||||
}
|
||||
indexLua := filepath.Join(dir, "www", "index.lua")
|
||||
if _, err := os.Stat(indexLua); os.IsNotExist(err) {
|
||||
content := `local fes = require("fes")
|
||||
content := fmt.Sprintf(`local fes = require("fes")
|
||||
local site = fes.fes()
|
||||
|
||||
site.title = "%s"
|
||||
|
||||
site:h1("Hello, World!")
|
||||
|
||||
return site
|
||||
`
|
||||
`, dir)
|
||||
if err := os.WriteFile(indexLua, []byte(content), 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -108,6 +108,18 @@ func loadLua(luaDir string, entry string, cfg *config.MyConfig) (string, error)
|
||||
return 1
|
||||
})
|
||||
|
||||
L.PreloadModule("core.symbol", func(L *lua.LState) int {
|
||||
data, err := config.Core.ReadFile("core/symbol.lua")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := L.DoString(string(data)); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
L.Push(L.Get(-1))
|
||||
return 1
|
||||
})
|
||||
|
||||
L.PreloadModule("fes", func(L *lua.LState) int {
|
||||
mod := L.NewTable()
|
||||
coreModules := []string{}
|
||||
|
||||
Reference in New Issue
Block a user