From 48f97c1e4a4795e553f4bdf583419175768bcbc4 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Thu, 8 May 2025 14:45:44 -0700 Subject: [PATCH] WIP: list directories --- .gitignore | 3 +++ docs/post1.md | 1 + site.moon | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 .gitignore create mode 100644 docs/post1.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d388c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/www/ +/logs/ +/*_temp/ diff --git a/docs/post1.md b/docs/post1.md new file mode 100644 index 0000000..44adfe9 --- /dev/null +++ b/docs/post1.md @@ -0,0 +1 @@ +# post 1 diff --git a/site.moon b/site.moon index c15fa82..969749e 100644 --- a/site.moon +++ b/site.moon @@ -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"