-- luacheck: globals name description class basedir webdir lockfile -- luacheck: globals url adtag conversion author templates affiliate -- luacheck: ignore 611 -- ************************************************************************ -- -- You get a full Lua environment when loading this file. This means you -- can do things like: -- -- os.setlocale("se_NO.UTF-8") -- basedir = os.getenv("HOME") .. "/source/boston/journal" -- webdir = os.getenv("HOME") .. "/source/boston/htdocs" -- -- Or more. -- -- ------------------------------------------------------------------------ -- -- This sample file lists all the possible fields that can be configured, -- with their default value (unless otherwise noted). -- -- name - title of the blog -- description - description of blog -- class - default keywords for blog -- basedir - location of journal entries -- webdir - location of web-accessible directory -- lockfile - lockfile (in case of multiple submissions at once) -- url - URL of blog, MUST end with a '/' -- adtag - default advertising keyword -- prehook - script to run before adding an entry -- argumnents: -- [1] body filename -- [2] meta information filename -- return: -- == 0 okay to add entry -- != 0 do not add entry -- posthook - script to run after adding an entry -- arguments: -- [1] URL of resulting post -- [2] title of post -- [3] author of post -- [4] status of post -- return: -- == 0 entry was added -- != 0 entry was not added -- -- ************************************************************************ name = "A Blog Grows in Cyberspace" description = "A place where I talk about stuff in cyperspace." class = "blog, rants, random stuff, programming" basedir = "." -- use full path for best results webdir = "htdocs" lockfile = ".modblog.lock" url = "http://www.example.com/blog/" adtag = "programming" -- prehook = "./prehook_script" -- no default -- posthook = "./posthook_script" -- no default -- ************************************************************************ -- -- Define the default (only?) author of the blog -- -- name - name of author -- email - email address of author -- file - if multiple authors, this is the location of a text file -- with colon separated fields specifying alternative authors -- who are permitted to post. -- fields - which fields of the given file contain the following info: -- uid - user id -- name - name -- email - email address -- -- If 'file' and 'fields' are not defined, then only the default author is -- allowed to post. The default value for 'fields' assumes an Apache style -- htpasswd file. -- -- ************************************************************************ author = { name = "Joe Blog" , email = "joe@example.com", -- file = "users", -- no default -- fields = { uid = 0 , name = 3 , email = 4 }, } -- ************************************************************************ -- -- Templates, or "How to generate some output" -- -- This is mandatory, and at least one template must be defined. The two -- mandatory fields are 'template' and 'output'. 'items' defaults to 15 and -- reverse to 'false'. posthook is optional with no default value. -- -- template - template directory -- output - output file -- items - how many items to output. If this is a number, then -- it's now many posts to include. If it's a string, -- it's the number of days worth of entries to include. -- An optional suffix can be include: 'd' for days, -- 'w' for weeks, or 'm' for month (30 days). -- reverse - if true, display entries in reverse chronological order -- posthook - a script to run once the template has been generated. -- arguments: -- [1] output file name -- [2] "new" if adding a new post -- "regenerate" if just regenerating the file -- -- ************************************************************************ templates = { { template = "html", output = webdir .. "/index.html", items = "7d", reverse = true, -- posthook = "posthook_template_script" -- no default }, { template = "rss", output = webdir .. "/index.rss", items = 15, reverse = true, }, { template = "atom", output = webdir .. "/index.atom", items = 15, reverse = true, }, { template = "json", output = webdir .. "/index.json", items = 15, reverse = true, } } -- ************************************************************************ -- -- Affiliate links, or rather, a shorthand for specifying URLs. For -- example: 'xkcd:795' will generate the link 'https://xkcd.com/795'. No -- default values here, and this entire block is optional. -- -- ************************************************************************ affiliate = { { proto = "asin", link = "http://www.amazon.com/exec/obidos/ASIN/%s/conmanlaborat-20" }, -- ---------------------------------------------------------- -- based upon https://news.ycombinator.com/item?id=12631664 -- ---------------------------------------------------------- { proto = "xkcd", link = "https://xkcd.com/%s" }, } .