Use Nix function to perform replacement
This commit is contained in:
8
lib.nix
8
lib.nix
@@ -7,11 +7,9 @@ let
|
||||
inherit (settings) src ssl host;
|
||||
name = "blog-static";
|
||||
version = settings.src.rev;
|
||||
urlSub =
|
||||
let
|
||||
regexEscape = lib.escape [ "/" "(" ")" "[" "]" "+" "*" "\\" ];
|
||||
in
|
||||
with settings.replaceUrl; "s/${regexEscape from}/${regexEscape to}/g";
|
||||
postPatch = with settings.replaceUrl; ''
|
||||
substituteInPlace config.toml --replace ${from} ${to}
|
||||
'';
|
||||
publicPath = settings.path;
|
||||
extraFlags = (if settings.drafts then " -D " else "") + settings.extraFlags;
|
||||
builder = ./build/builder.sh;
|
||||
|
||||
Reference in New Issue
Block a user