WIP: list directories

This commit is contained in:
Catalin Constantin Mititiuc 2025-05-08 14:45:44 -07:00
parent 6a76dcac18
commit 48f97c1e4a
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" 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 => sitegen.create =>
@title = "Hello World" @title = "Hello World"
add "index.md" add "index.md"
add "docs/post1.md", target: "/posts/post1"