WIP: list directories
This commit is contained in:
parent
6a76dcac18
commit
48f97c1e4a
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/www/
|
||||||
|
/logs/
|
||||||
|
/*_temp/
|
1
docs/post1.md
Normal file
1
docs/post1.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# post 1
|
19
site.moon
19
site.moon
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user