WIP: list directories

This commit is contained in:
Catalin Constantin Mititiuc 2025-06-16 20:16:37 -07:00
parent 040749dcc9
commit 13b7a5d6db
3 changed files with 23 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/www/
/logs/
/*_temp/

1
docs/post1.md Normal file
View File

@ -0,0 +1 @@
# post 1

View File

@ -1,4 +1,23 @@
sitegen = require "sitegen"
lfs = require "lfs"
attrdir = (path) ->
for file in lfs.dir(path)
if file != "." and file != ".."
f = path .. '/' .. file
print "\t " .. f
attr = lfs.attributes(f)
assert type(attr) == "table"
attrdir(f) if attr.mode == "directory"
-- if attr.mode == "directory"
-- attrdir(f)
-- else
-- for name, value in pairs attr
-- print name, value
-- attrdir "www"
sitegen.create =>
@title = "Hello World"
add "index.md"
add "docs/post1.md", target: "/posts/post1"