Add CNAME file for github pages
This commit is contained in:
parent
334534980a
commit
dbabccdfd4
3 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,3 @@
|
||||||
local csv = require 'streamcsv'
|
|
||||||
local fun = require 'fun'
|
local fun = require 'fun'
|
||||||
local json = require 'cjson'
|
local json = require 'cjson'
|
||||||
local restia = require 'restia'
|
local restia = require 'restia'
|
||||||
|
@ -61,4 +60,8 @@ tree["posts.json"] = json.encode(
|
||||||
|
|
||||||
tree["index.html"] = tostring(page("index", tree["posts.json"]))
|
tree["index.html"] = tostring(page("index", tree["posts.json"]))
|
||||||
|
|
||||||
|
if params.cname then
|
||||||
|
tree.CNAME = params.cname
|
||||||
|
end
|
||||||
|
|
||||||
scaffold.builddir(params.output, tree)
|
scaffold.builddir(params.output, tree)
|
||||||
|
|
|
@ -8,6 +8,7 @@ return function(...)
|
||||||
{ "Input directory", "--input", "-i", 'directory' };
|
{ "Input directory", "--input", "-i", 'directory' };
|
||||||
{ "Copy directory", "--copy", "-c", 'directory', 'repeatable' };
|
{ "Copy directory", "--copy", "-c", 'directory', 'repeatable' };
|
||||||
{ "Include unpublished posts", "--unpublished", "-u", nil };
|
{ "Include unpublished posts", "--unpublished", "-u", nil };
|
||||||
|
{ "Set the github pages CNAME", "--cname", nil, 'domain' };
|
||||||
{ "Delete everything first", "--delete", "-d" };
|
{ "Delete everything first", "--delete", "-d" };
|
||||||
}
|
}
|
||||||
local validate = shapeshift.table {
|
local validate = shapeshift.table {
|
||||||
|
@ -17,6 +18,7 @@ return function(...)
|
||||||
is.table,
|
is.table,
|
||||||
shapeshift.each(is.string)
|
shapeshift.each(is.string)
|
||||||
});
|
});
|
||||||
|
cname = shapeshift.any(is.Nil, is.string);
|
||||||
unpublished = shapeshift.default(false, shapeshift.is.boolean);
|
unpublished = shapeshift.default(false, shapeshift.is.boolean);
|
||||||
delete = shapeshift.default(false, shapeshift.is.boolean);
|
delete = shapeshift.default(false, shapeshift.is.boolean);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ task.build {
|
||||||
[[
|
[[
|
||||||
export LUA_PATH='%s'
|
export LUA_PATH='%s'
|
||||||
export LUA_CPATH='%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
|
path, cpath
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue