diff --git a/build.lua b/build.lua index 0ba9f88..4299278 100644 --- a/build.lua +++ b/build.lua @@ -1,4 +1,3 @@ -local csv = require 'streamcsv' local fun = require 'fun' local json = require 'cjson' local restia = require 'restia' @@ -61,4 +60,8 @@ tree["posts.json"] = json.encode( tree["index.html"] = tostring(page("index", tree["posts.json"])) +if params.cname then + tree.CNAME = params.cname +end + scaffold.builddir(params.output, tree) diff --git a/lib/paramparser.lua b/lib/paramparser.lua index 40316ee..456e556 100644 --- a/lib/paramparser.lua +++ b/lib/paramparser.lua @@ -8,6 +8,7 @@ return function(...) { "Input directory", "--input", "-i", 'directory' }; { "Copy directory", "--copy", "-c", 'directory', 'repeatable' }; { "Include unpublished posts", "--unpublished", "-u", nil }; + { "Set the github pages CNAME", "--cname", nil, 'domain' }; { "Delete everything first", "--delete", "-d" }; } local validate = shapeshift.table { @@ -17,6 +18,7 @@ return function(...) is.table, shapeshift.each(is.string) }); + cname = shapeshift.any(is.Nil, is.string); unpublished = shapeshift.default(false, shapeshift.is.boolean); delete = shapeshift.default(false, shapeshift.is.boolean); } diff --git a/tasks.lua b/tasks.lua index ceb9512..5f35b4f 100644 --- a/tasks.lua +++ b/tasks.lua @@ -20,7 +20,7 @@ task.build { [[ export LUA_PATH='%s' export LUA_CPATH='%s' - lua build.lua --copy css --copy javascript --output blog + lua build.lua --copy css --copy javascript --output blog --cname blog.but.gay ]], path, cpath )