Add CNAME file for github pages

This commit is contained in:
Talia 2023-07-22 00:03:49 +02:00
parent 334534980a
commit dbabccdfd4
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E
3 changed files with 7 additions and 2 deletions

View file

@ -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)

View file

@ -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);
} }

View file

@ -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
) )