#!/usr/bin/env node /** * Сборка лендинга Цифровой Кооператив * Объединяет партиалы. CSS и JS подключаются из src/ * * Запуск: node build.mjs */ import { readFileSync, writeFileSync } from 'fs'; import { join, dirname } from 'path'; import { fileURLToPath } from 'url'; const __dirname = dirname(fileURLToPath(import.meta.url)); const ROOT = join(__dirname); const SRC = join(ROOT, 'src'); /** Favicon для всех страниц: править только здесь */ const FAVICON_LINK = ''; /** HTML в корне, не собираемые из партиалов — favicon подставляется при сборке */ const STANDALONE_PAGES = ['documents.html', 'proposal.html', 'contacts.html']; const PARTIALS_ORDER = [ 'nav', 'hero', 'why', 'ready', 'registries', 'docsplit', 'store', 'reporting', 'chatcoop', 'pricing', 'connect', 'cta', 'footer', ]; function build() { // 1. Собираем HTML из партиалов const bodyParts = []; for (const name of PARTIALS_ORDER) { const path = join(SRC, 'partials', `${name}.html`); try { bodyParts.push(readFileSync(path, 'utf-8')); } catch (e) { console.warn(`Пропуск ${name}.html:`, e.message); } } const bodyContent = bodyParts.join('\n\n'); // 2. Шаблон index.html const indexHtml = `
${FAVICON_LINK}