Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mod_blog/journal/blog.conf
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
187 lines (171 sloc)
6.49 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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 | |
| -- conversion - input conversion ('html', 'mixed', 'text' , 'none') | |
| -- 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 | |
| -- | |
| -- ************************************************************************ | |
| 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" | |
| conversion = "html" | |
| -- 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 }, | |
| } | |
| -- ************************************************************************ | |
| -- | |
| -- Email notification | |
| -- | |
| -- There are no defaults for any of this information, and to even use it, | |
| -- you'll need a tool that isn't provided by this repository. Even I barely | |
| -- use it, having only three people signed up. I found out years ago that | |
| -- having a form to fill out is useless as spammers will spam the form even | |
| -- when there's nothing to gain from it. You are on your own if you want to | |
| -- use email notification. But just in case you can engineer how this is | |
| -- supposed to work: | |
| -- | |
| -- list - databse of email addresses | |
| -- message - text file of email (template based) | |
| -- subject - subject line | |
| -- | |
| -- ************************************************************************ | |
| -- email = | |
| -- { | |
| -- list = "./notify/email.db", -- no default | |
| -- message = "./notify/message.txt", -- no default | |
| -- subject = name .. " Update Notification", -- no default | |
| -- } | |
| -- ************************************************************************ | |
| -- | |
| -- 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" | |
| }, | |
| } |