build.lua

changeset 11
36dd235e09d2
parent 8
6dc28a66f4d9
child 12
4c759312950b
equal deleted inserted replaced
10:58f3707e44d7 11:36dd235e09d2
49 local post_data, err = post_file:read("*a"); 49 local post_data, err = post_file:read("*a");
50 50
51 -- Parse post_data according to extension, add to post list 51 -- Parse post_data according to extension, add to post list
52 --msg_info("Parsing %s...", post_filename) --:gsub("%.[^%.]+$", ""):match("[^/]+")); 52 --msg_info("Parsing %s...", post_filename) --:gsub("%.[^%.]+$", ""):match("[^/]+"));
53 post.content = templates.load(parsers[post_format](post_data)):render{ page = post }; 53 post.content = templates.load(parsers[post_format](post_data)):render{ page = post };
54 post.shorttile = make_short_title(post.title); 54 post.shorttitle = make_short_title(post.title);
55 post.url = base_url..post.shorttitle.."/" 55 post.url = base_url..post.shorttitle.."/"
56 post.post = post 56 post.post = post
57 post.updated = post.updated or os.date("!%Y-%m-%dT%H:%M:%SZ", lfs.attributes(post.path).modification); 57 post.updated = post.updated or os.date("!%Y-%m-%dT%H:%M:%SZ", lfs.attributes(post.path).modification);
58 if post.published then 58 if post.published then
59 if not post.published:match("^%d%d%d%d%-%d%d%-%d%dT%d%d:%d%d%:%d%dZ$") then 59 if not post.published:match("^%d%d%d%d%-%d%d%-%d%dT%d%d:%d%d%:%d%dZ$") then

mercurial