Add nix build script to generate static files

This commit is contained in:
thiloho
2023-08-01 22:59:28 +00:00
parent 0017fcdfa7
commit a7a1570805
5 changed files with 918 additions and 854 deletions

3
.gitignore vendored
View File

@@ -19,3 +19,6 @@ pnpm-debug.log*
# macOS-specific files # macOS-specific files
.DS_Store .DS_Store
result
result-*

View File

@@ -1,4 +1,4 @@
import { defineConfig, sharpImageService } from "astro/config"; import { defineConfig } from "astro/config";
import { rehypeHeadingIds } from "@astrojs/markdown-remark"; import { rehypeHeadingIds } from "@astrojs/markdown-remark";
import rehypeAutolinkHeadings from "rehype-autolink-headings"; import rehypeAutolinkHeadings from "rehype-autolink-headings";
import svelte from "@astrojs/svelte"; import svelte from "@astrojs/svelte";
@@ -8,8 +8,7 @@ export default defineConfig({
site: "https://aurora.thilohohlt.com", site: "https://aurora.thilohohlt.com",
compressHTML: true, compressHTML: true,
experimental: { experimental: {
assets: true, assets: true
inlineStylesheets: "auto",
}, },
scopedStyleStrategy: "class", scopedStyleStrategy: "class",
markdown: { markdown: {
@@ -26,8 +25,5 @@ export default defineConfig({
], ],
], ],
}, },
image: {
service: sharpImageService(),
},
integrations: [svelte()], integrations: [svelte()],
}); });

View File

@@ -20,11 +20,19 @@
}); });
in in
{ {
devShells = forAllSystems ({ pkgs }: { packages = forAllSystems ({ pkgs }: {
default = pkgs.mkShell { default = pkgs.buildNpmPackage {
packages = with pkgs; [ name = "build-aurora-blog";
nodejs # Node.js, plus npm, npx, and corepack buildInputs = with pkgs; [
nodejs_18
]; ];
src = ./.;
npmDepsHash = "sha256-K30UsMZ508XT1x/1eXY/xg7dfhLm55pdi9vOdDQHtWg=";
npmBuild = "npm run build";
installPhase = ''
mkdir $out
cp -r dist/* $out
'';
}; };
}); });
}; };

1742
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,6 @@
"astro": "^2.5.3", "astro": "^2.5.3",
"open-props": "^1.5.8", "open-props": "^1.5.8",
"rehype-autolink-headings": "^6.1.1", "rehype-autolink-headings": "^6.1.1",
"sharp": "^0.32.1",
"svelte": "^3.59.1" "svelte": "^3.59.1"
} }
} }