From 1d59a19168c3106c4dc64e971322cd2a2e6e57b4 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 3 Dec 2024 21:15:46 +0000 Subject: [PATCH] Fix JSON-LD, use faster minifier --- _includes/place-json-ld.liquid | 14 +++++++------- default.nix | 4 ++-- static/{not_found.html => 404.html} | 0 3 files changed, 9 insertions(+), 9 deletions(-) rename static/{not_found.html => 404.html} (100%) diff --git a/_includes/place-json-ld.liquid b/_includes/place-json-ld.liquid index e5b310e..6132467 100644 --- a/_includes/place-json-ld.liquid +++ b/_includes/place-json-ld.liquid @@ -2,16 +2,16 @@ { "@context": "http://schema.org", "@type": "LocalBusiness", - "name": "{{ name }}", - {%- if email -%}"email": "{{ email }}",{%- endif -%} - {%- if phone -%}"telephone": "{{ phone }}",{%- endif -%} - {%- if web -%}"url": "{{ web }}",{%- endif -%} - {%- if facebook or instagram -%} "sameAs": [ + "name": "{{ name }}" + {%- if email -%}, "email": "{{ email }}"{%- endif -%} + {%- if phone -%}, "telephone": "{{ phone }}"{%- endif -%} + {%- if web -%}, "url": "{{ web }}"{%- endif -%} + {%- if facebook or instagram -%}, "sameAs": [ {%- if facebook -%}"{{ facebook }}"{%- endif -%} {%- if facebook and instagram -%},{%- endif -%} {%- if instagram -%}"{{ instagram }}"{%- endif -%} - ],{%- endif -%} - {%- if google -%}"hasMap": "{{ google }}"{%- endif -%} + ]{%- endif -%} + {%- if google -%}, "hasMap": "{{ google }}"{%- endif -%} {%- if address -%} , "address": { "@type": "PostalAddress", diff --git a/default.nix b/default.nix index 83fc4ba..7640a53 100644 --- a/default.nix +++ b/default.nix @@ -20,7 +20,7 @@ pkgs.stdenv.mkDerivation { nativeBuildInputs = with pkgs; [ cacert - html-minifier + minify lightningcss sass yarn @@ -46,7 +46,7 @@ pkgs.stdenv.mkDerivation { yarn --offline eleventy echo 'Minifying HTML' - html-minifier --input-dir _site --output-dir _site --collapse-whitespace --file-ext html + minify --all --recursive --output . _site ''; installPhase = '' diff --git a/static/not_found.html b/static/404.html similarity index 100% rename from static/not_found.html rename to static/404.html