project now creates a static site using python
This commit is contained in:
1 parent
65f63b05d3
commit
aa7ef06858
15 files changed
+1155
-1
No files matched your search
@@ -117,6 +117,24 @@
|
||||
vscode = pkgs.vscodium;
|
||||
vscodeExtensions = extensions;
|
||||
};
|
||||
|
||||
scripts = [
|
||||
(pkgs.writeShellScriptBin "build" ''
|
||||
exec python build.py "$@"
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "serve" ''
|
||||
port="''${1:-8000}"
|
||||
python build.py || exit 1
|
||||
echo "Serving public/ at http://localhost:$port"
|
||||
exec python -m http.server "$port" --directory public
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "watch-site" ''
|
||||
exec watchfiles "python build.py" templates pages static ../content
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "linkcheck" ''
|
||||
exec lychee --offline --no-progress public
|
||||
'')
|
||||
];
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
@@ -131,7 +149,8 @@
|
||||
pkgs.prettier
|
||||
pkgs.git
|
||||
pkgs.nixpkgs-fmt
|
||||
];
|
||||
]
|
||||
++ scripts;
|
||||
|
||||
shellHook = ''
|
||||
# Build the site (expects build.py in the current directory)
|
||||
|
||||
Reference in new issue
Block a user