fingerprint deployed stylesheet assets
This commit is contained in:
parent
d9e2acd808
commit
34f3bd5c44
2 changed files with 11 additions and 2 deletions
10
nix/site.nix
10
nix/site.nix
|
|
@ -1,5 +1,10 @@
|
|||
{ pkgs }:
|
||||
|
||||
let
|
||||
stylesheetHash = builtins.substring 0 12 (builtins.hashFile "sha256" ../site/styles.css);
|
||||
stylesheetFileName = "styles-${stylesheetHash}.css";
|
||||
in
|
||||
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
pname = "tide-landing-page";
|
||||
version = "1.0.0";
|
||||
|
|
@ -12,6 +17,11 @@ pkgs.stdenvNoCC.mkDerivation {
|
|||
|
||||
mkdir -p "$out"
|
||||
cp -R . "$out"
|
||||
mv "$out/styles.css" "$out/${stylesheetFileName}"
|
||||
substituteInPlace "$out/index.html" \
|
||||
--replace-fail \
|
||||
'href="/styles.css"' \
|
||||
'href="/${stylesheetFileName}"'
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue