perf(site): serve responsive WebP and compressed Hub videos

This commit is contained in:
DCCONSTRUCTIONS
2026-11-06 03:24:43 +03:00
parent 1b4fe33957
commit f7951374a8
204 changed files with 2438 additions and 128 deletions
+4
View File
@@ -1,3 +1,4 @@
import { applyResponsiveImages } from "./responsive-images.mjs";
import { mkdir, readFile, writeFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
@@ -459,6 +460,7 @@ async function renderBlock(block, renderCounts) {
description: "", imageSrc: "", imageAlt: "", videoSrc: "", posterSrc: "", ...item,
detailsHref: safeArticleHref(item.detailsHref),
detailsLabel: typeof item.detailsLabel === "string" && item.detailsLabel.trim() ? item.detailsLabel.trim() : "Подробнее",
imageSizes: ["photo-gallery", "scenario-gallery"].includes(block.content.mediaKind) ? "(max-width: 767px) 82vw, 560px" : "(max-width: 767px) 86vw, 1280px",
imageLinkEnabled: block.content.openImagesInFullscreen === true,
imageLinkDisabled: block.content.openImagesInFullscreen !== true,
}));
@@ -544,3 +546,5 @@ await writeFile(outputPath, output);
await writeSeoFiles(page);
console.log(`Rendered ${page.slug} -> ${outputPath}`);
await applyResponsiveImages(repoRoot);