util.lua

changeset 8
6dc28a66f4d9
parent 6
cf40d55f8122
child 9
13eb9435e1c0
equal deleted inserted replaced
7:9ab155822b0b 8:6dc28a66f4d9
5 if #long_title:gsub("%W+", "-") > 45 then 5 if #long_title:gsub("%W+", "-") > 45 then
6 short_title = short_title:gsub("%-%w+$", ""); 6 short_title = short_title:gsub("%-%w+$", "");
7 end 7 end
8 return short_title; 8 return short_title;
9 end 9 end
10
11 -- Config --
12
13 dofile(arg[1] or ".blogrc")
14
15 posts_dir = posts_dir or "_posts/"
16 layouts_dir = layouts_dir or "_layouts/"
17 output_dir = output_dir or "./"
18 -- - -- - --
19
20 -- Append '/' to end of posts_dir if necessary
21 posts_dir = posts_dir:gsub("([^/])$", "%1/")
22
23 -- Append '/' to end of output_dir if necessary
24 output_dir = output_dir:gsub("([^/])$", "%1/")
25
26 -- Append '/' to end of base_url if necessary
27 base_url = base_url:gsub("([^/])$", "%1/")
28

mercurial