add gzip and move config to environment files

pyrox.dev 1e28d4df 407c8d61

verified
Changed files
+38 -6
.forgejo
workflows
+2
.env.dev
···
+
export LUME_DRAFTS="true"
+
export BROTLI_LEVEL=6
+2
.env.prod
···
+
export LUME_DRAFTS="false"
+
export BROTLI_LEVEL=11
-1
.envrc
···
fi
PATH_add $HOME/.deno/bin
export ROOT="$PWD"
-
export LUME_DRAFTS="true"
use flake . --impure
+1 -1
.forgejo/workflows/deploy.yaml
···
submodules: true
- name: Run Lume Build
-
run: nix run nixpkgs#deno -- task build
+
run: nix run nixpkgs#deno -- task prod
- name: Deploy
uses: https://git.pyrox.dev/actions/pages-action@v3
+19 -1
_config.ts
···
// Optimization
import brotli from "lume/plugins/brotli.ts";
+
import gzip from "lume/plugins/gzip.ts";
import minify_html from "lume/plugins/minify_html.ts";
import svgo from "lume/plugins/svgo.ts";
import transform_images from "lume/plugins/transform_images.ts";
···
}),
);
-
// Compress everything with Brotli
+
// Compress everything with Brotli/Gzip
site.use(
brotli({
+
quality: Deno.env.get("BROTLI_LEVEL"),
+
extensions: [
+
".html",
+
".css",
+
".js",
+
".mjs",
+
".svg",
+
".json",
+
".xml",
+
".txt",
+
".rss",
+
".map",
+
],
+
}),
+
);
+
site.use(
+
gzip({
extensions: [
".html",
".css",
+3 -2
deno.json
···
"sharp": "npm:sharp@0.33.5"
},
"tasks": {
-
"lume": "echo \"import 'lume/cli.ts'\" | deno run -A -",
+
"lume": "echo \"import 'lume/cli.ts'\" | deno run --env-file=.env.dev -A -",
+
"prod": "echo \"import 'lume/cli.ts'\" | deno run --env-file=.env.prod -A -",
"build": "deno task lume",
-
"serve": "deno task lume -s",
+
"serve": "deno task lume -s ",
"fmt": "deno task dprint fmt",
"fmt:check": "deno task dprint check",
"dprint": "deno run -A npm:dprint"
+11 -1
deno.lock
···
"specifiers": {
"jsr:@davidbonnet/astring@1.8.6": "1.8.6",
"jsr:@hono/hono@4.6.16": "4.6.16",
+
"jsr:@std/bytes@^1.0.5": "1.0.5",
"jsr:@std/cli@1.0.11": "1.0.11",
"jsr:@std/cli@1.0.12": "1.0.12",
"jsr:@std/cli@1.0.13": "1.0.13",
···
"jsr:@std/net@^1.0.4": "1.0.4",
"jsr:@std/path@1.0.8": "1.0.8",
"jsr:@std/path@^1.0.8": "1.0.8",
+
"jsr:@std/streams@1.0.9": "1.0.9",
"jsr:@std/streams@^1.0.8": "1.0.9",
"jsr:@std/streams@^1.0.9": "1.0.9",
"jsr:@std/tar@0.1.4": "0.1.4",
···
},
"@hono/hono@4.6.16": {
"integrity": "b540c6b1352d73142895f7bb6bfd0b6cc514ede61c12940338c4ae5dd06cb326"
+
},
+
"@std/bytes@1.0.5": {
+
"integrity": "4465dd739d7963d964c809202ebea6d5c6b8e3829ef25c6a224290fbb8a1021e"
},
"@std/cli@1.0.11": {
"integrity": "ec219619fdcd31bcf0d8e53bee1e2706ec9a02f70255365a094f69755dadd340"
···
"integrity": "548fa456bb6a04d3c1a1e7477986b6cffbce95102d0bb447c67c4ee70e0364be"
},
"@std/streams@1.0.9": {
-
"integrity": "a9d26b1988cdd7aa7b1f4b51e1c36c1557f3f252880fa6cc5b9f37078b1a5035"
+
"integrity": "a9d26b1988cdd7aa7b1f4b51e1c36c1557f3f252880fa6cc5b9f37078b1a5035",
+
"dependencies": [
+
"jsr:@std/bytes"
+
]
},
"@std/tar@0.1.4": {
"integrity": "1bc1f1f9bfd557e849b31d6521348fdf5848886d87c851f1f0f992d002fe0ff5",
···
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/deps/purgecss.ts": "524914d3311933aaeb8052c89c361efdc4656bf6fb8aeec9d1b3d7750dbf8d3f",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/deps/remove-markdown.ts": "c975349bb4b0a325384b8171b1648d5b79366efc8814413c8e93bfeded3280e3",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/deps/sharp.ts": "b0692f7293a33a6b191ef672420e3eb37c308ccbe5cf55d15231254e2972a8e0",
+
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/deps/streams.ts": "e78fdd0a968390117fb3d6bd83de09b72f54eec27d8ef873aea9ad03c1087c3b",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/deps/svg2png.ts": "d761fb39c37e5c5ba4ac2db25768cf0c2ff34643d3d1847a9fe736449175d5ec",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/deps/svgo.ts": "688d1272b1a2113d8ad35e70854a189d6c238b04b8237529acdaa8028abc40d6",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/deps/tailwindcss.ts": "f3103ddcb10e234f33d9cdb0a776bfaacceae93d93fbdfb990372b7bcfed4836",
···
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/plugins/date.ts": "cbf280a28f8aef6f2c9ab9b5234875ab5994fe68e0f977798043e056dfc9a56f",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/plugins/feed.ts": "914702397b3dc533a4cb7bd7e88f04f9f379390780ea6990a511e2390c57ab4b",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/plugins/google_fonts.ts": "773c5d5855407ef127a97817c84f521a8006596bde04fb47231ec20900378a72",
+
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/plugins/gzip.ts": "0026c36672db566ebc7dc0d48d0b94ad21063c9b7ebf691ab9d78aa62ed88784",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/plugins/json.ts": "5c49499e56b919ec848d4118ec97dd4fe0a323a6cc4c648dc45ab55297614c12",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/plugins/lightningcss.ts": "2006c712b89e9f0b88852127efc7f4c856eefec565941c5ab9ea362d35ae996a",
"https://cdn.jsdelivr.net/gh/lumeland/lume@f6e8b76726f84055e7d56f201bad44ab4162ed9c/plugins/markdown.ts": "7e82d897c1e35bf119dcd18b6aec7a6ba5aa06848897b34ff9cd161ec7c8757e",