Комплексные улучшения: FAQ, форма, карта, WhatsApp/Telegram, SEO
- FloatingContacts: кнопки WhatsApp + Telegram (правый нижний угол) - ScrollToTop: кнопка "наверх" (появляется после 400px скролла) - FAQ секция: 6 вопросов с аккордеоном, id=faq в навбаре - Hero: телефон под CTA кнопками - Форма: поле телефона, реальная отправка (fetch FormSpree или mailto fallback) - Яндекс.Карты embed в блоке контактов - Navigation: убран дубль "Контакты" из links, добавлен FAQ - img width/height на логотипах (антиCLS) - JSON-LD: og-image.svg → .png, добавлен postalCode, уточнен streetAddress - prerender.mjs: динамически обновляет хеш preload шрифта - src/config.js: централизованный конфиг (WhatsApp, Telegram, form endpoint) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { readFileSync, writeFileSync, rmSync } from 'fs'
|
||||
import { readFileSync, writeFileSync, rmSync, readdirSync } from 'fs'
|
||||
import { resolve, dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
@@ -8,9 +8,23 @@ const root = resolve(__dirname, '..')
|
||||
// Import SSR bundle built by vite build --ssr
|
||||
const { render } = await import('../dist/server/entry-server.js')
|
||||
|
||||
const template = readFileSync(resolve(root, 'dist/index.html'), 'utf-8')
|
||||
let html = readFileSync(resolve(root, 'dist/index.html'), 'utf-8')
|
||||
|
||||
// Inject prerendered HTML
|
||||
const appHtml = render()
|
||||
const html = template.replace('<div id="root"></div>', `<div id="root">${appHtml}</div>`)
|
||||
html = html.replace('<div id="root"></div>', `<div id="root">${appHtml}</div>`)
|
||||
|
||||
// Fix preload font: find actual cyrillic-700 woff2 hash in dist/assets
|
||||
const assetsDir = resolve(root, 'dist/assets')
|
||||
const fontFile = readdirSync(assetsDir).find(f => f.match(/manrope-cyrillic-700-normal-.+\.woff2/))
|
||||
if (fontFile) {
|
||||
html = html.replace(
|
||||
/href="\/assets\/manrope-cyrillic-700-normal-[^"]+\.woff2"/,
|
||||
`href="/assets/${fontFile}"`
|
||||
)
|
||||
console.log(`✓ Preload font updated: ${fontFile}`)
|
||||
}
|
||||
|
||||
writeFileSync(resolve(root, 'dist/index.html'), html)
|
||||
|
||||
// Cleanup SSR bundle
|
||||
|
||||
Reference in New Issue
Block a user