diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index e6f57056..7f4a36df 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -135,3 +135,7 @@ jobs: # og-default.png). Regressions surface as warnings. run: node scripts/check-og-image.cjs continue-on-error: true + + - name: 🎭 Playwright visual regression (screenshots of key pages) + run: npx playwright test --update-snapshots + continue-on-error: true diff --git a/assets/css/design-system.css b/assets/css/design-system.css index 22eb54f6..286bae5f 100644 --- a/assets/css/design-system.css +++ b/assets/css/design-system.css @@ -323,7 +323,35 @@ code { } .burger { display: inline-flex; } -/* ---------- MOBILE BACKDROP ---------- */ +/* ---------- SCROLL TO TOP ---------- */ +.scroll-to-top { + position: fixed; + bottom: 2rem; + right: 2rem; + z-index: 100; + width: 48px; + height: 48px; + border-radius: 50%; + border: 1px solid var(--line); + background: var(--paper-2); + color: var(--ink-700); + font-size: 1.25rem; + cursor: pointer; + opacity: 0; + transform: translateY(20px); + transition: opacity .25s ease, transform .25s ease, background .25s ease; + pointer-events: none; +} +.scroll-to-top.visible { + opacity: 1; + transform: translateY(0); + pointer-events: auto; +} +.scroll-to-top:hover { + background: var(--accent); + color: #fff; + border-color: var(--accent); +} .neo-mobile-backdrop { position: fixed; inset: 0; @@ -448,25 +476,56 @@ code { flex-wrap: wrap; } -/* ---------- FEATURED EDITORIAL GRID ---------- */ -.editorial-grid { +/* ---------- FEATURED EDITORIAL LAYOUT ---------- */ +/* 1 large lead card + 2 smaller sub cards stacked on the right */ +.editorial-featured { display: grid; - grid-template-columns: 1.4fr 1fr; - grid-template-rows: auto auto; + grid-template-columns: 1.6fr 1fr; gap: var(--space-4); margin-top: var(--space-8); } -.editorial-grid .card.lead { - grid-row: span 2; +.card-lead { + display: flex; + flex-direction: column; + gap: var(--space-3); + padding: var(--space-6); + background: var(--paper-2); + border: 1px solid var(--line); + border-radius: var(--radius); } -.editorial-grid .card h3 { +.card-lead h3 { font-family: var(--font-display); - font-size: 1.25rem; + font-size: 1.5rem; line-height: 1.25; } -.editorial-grid .card p { +.card-lead p { color: var(--ink-600); - margin-top: var(--space-2); + font-size: 1.05rem; + line-height: 1.6; +} +.editorial-side { + display: flex; + flex-direction: column; + gap: var(--space-4); +} +.card-sub { + display: flex; + flex-direction: column; + gap: var(--space-2); + padding: var(--space-4); + background: var(--paper-2); + border: 1px solid var(--line); + border-radius: var(--radius); +} +.card-sub h3 { + font-family: var(--font-display); + font-size: 1rem; + line-height: 1.3; +} +.card-sub p { + color: var(--ink-600); + font-size: .9rem; + line-height: 1.5; } .editorial-meta { color: var(--ink-500); @@ -642,7 +701,7 @@ code { .post-layout { grid-template-columns: 1fr; } .toc { display: none; } .primary-nav { display: none; } - .editorial-grid { grid-template-columns: 1fr; } + .editorial-featured { grid-template-columns: 1fr; } .recent-row { grid-template-columns: 1fr; gap: var(--space-1); } .hero { padding: var(--space-10) 0; } } diff --git a/assets/css/neo.css b/assets/css/neo.css index 19280ff6..7cdede21 100644 --- a/assets/css/neo.css +++ b/assets/css/neo.css @@ -87,7 +87,6 @@ body::before{ /* ---------- LAYOUT ---------- */ .neo-wrap{max-width:var(--content-max,720px);margin:0 auto;padding:0 1.25rem} .neo-header{position:sticky;top:0;z-index:50;background:rgba(11,14,20,.88);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--line)} -.neo-header-inner{display:flex;align-items:center;gap:1rem;max-width:var(--content-max,1100px);margin:0 auto;padding:.6rem 1.25rem} .neo-brand{font-weight:800;font-size:1.1rem;letter-spacing:-.02em} .neo-brand .mark{color:var(--accent)} .neo-nav{display:flex;gap:.5rem;margin-left:auto} @@ -101,14 +100,7 @@ body::before{ .neo-drawer.open{display:block} .neo-drawer h5{font-family:var(--mono);font-size:11px;color:var(--accent);letter-spacing:1px;text-transform:uppercase;margin:14px 0 8px} .neo-drawer h5:first-child{margin-top:0} -.neo-theme-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px} -.neo-theme-opt,.neo-accent-opt{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--line-2);border-radius:8px;cursor:pointer;color:var(--muted);transition:border-color .2s,color .2s} .neo-theme-opt.active,.neo-accent-opt.active{border-color:var(--accent);color:var(--text)} -.neo-sw{width:16px;height:16px;border-radius:4px;border:1px solid var(--line-2)} -.neo-accent-grid{display:flex;gap:8px;flex-wrap:wrap} -.neo-accent-opt{width:32px;height:32px;padding:0;justify-content:center} -.neo-row-opt{display:flex;align-items:center;justify-content:space-between;padding:6px 0;color:var(--muted)} -.neo-seg{display:flex;border:1px solid var(--line-2);border-radius:8px;overflow:hidden} .neo-seg button{background:var(--panel);border:none;color:var(--muted);padding:6px 10px;cursor:pointer;font-size:12px;font-family:var(--mono)} .neo-seg button.active{background:var(--accent);color:#07121a} @@ -121,7 +113,6 @@ body::before{ .neo-eyebrow{font-size:.8rem;color:var(--muted);margin-bottom:.3rem} .neo-post h1{font-size:clamp(1.6rem,4vw,2.4rem);font-weight:800;line-height:1.2;margin-bottom:.5rem} .neo-post .lead{font-size:1.1rem;color:var(--muted)} -.neo-post-meta{display:flex;gap:.8rem;font-size:.8rem;color:var(--muted);margin-top:.8rem} .neo-post-body{line-height:1.75} .neo-post-body h2{font-size:1.3rem;font-weight:700;margin:1.5rem 0 .5rem} .neo-post-body h3{font-size:1.1rem;font-weight:600;margin:1.2rem 0 .4rem} @@ -155,27 +146,17 @@ body::before{ /* ---------- SEARCH ---------- */ .neo-search-input{width:100%;padding:.7rem 1rem;border-radius:var(--radius);border:1px solid var(--line);background:var(--panel);color:var(--text);font-size:1rem;margin:1rem 0} .neo-search-input:focus{outline:none;border-color:var(--accent)} -.neo-kind-filter{display:flex;gap:.3rem;margin-bottom:1rem;flex-wrap:wrap} .neo-kind-filter button{padding:.3rem .7rem;border-radius:8px;border:1px solid var(--line);background:transparent;color:var(--muted);font-size:.8rem;cursor:pointer;transition:all .2s} .neo-kind-filter button[aria-pressed="true"]{background:var(--accent);color:#06121a;border-color:var(--accent)} .neo-search-empty{padding:2rem;text-align:center;color:var(--muted)} /* ---------- ANALYTICS ---------- */ -.neo-analytics{display:flex;flex-direction:column;gap:.4rem;margin:1rem 0} -.neo-analytic-row{display:flex;align-items:center;gap:.8rem} -.neo-analytic-path{flex:1;font-size:.8rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)} -.neo-analytic-bar{flex:1;height:8px;background:var(--panel);border-radius:4px;overflow:hidden} .neo-analytic-bar div{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent-2));border-radius:4px} -.neo-analytic-count{font-size:.8rem;color:var(--muted);min-width:30px;text-align:right} /* ---------- RETENTION ---------- */ -.neo-retention{display:flex;gap:4px;align-items:flex-end;height:120px;margin-top:1rem} -.neo-retention-day{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;height:100%} -.neo-retention-bar{width:100%;background:linear-gradient(to top,var(--accent),var(--accent-2));border-radius:4px 4px 0 0;min-height:2px;transition:height .3s} .neo-retention-day span{font-size:.65rem;color:var(--muted);white-space:nowrap} /* ---------- FAVORITES ---------- */ -.neo-fav-summary{margin:2rem 0} .neo-fav-summary .neo-featured{margin-top:1rem} /* ---------- SUBSCRIBE ---------- */ @@ -194,12 +175,9 @@ body::before{ .neo-btn-primary{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#06121a;border:none;font-weight:600} /* ---------- FOOTER ---------- */ -.neo-footer{margin-top:3rem;padding:1.5rem 1.25rem;border-top:1px solid var(--line);text-align:center;font-size:.8rem;color:var(--muted)} .neo-footer a{color:var(--accent)} /* ---------- UTILITIES ---------- */ -.neo-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0} -.neo-skip{position:fixed;top:-100%;left:50%;transform:translateX(-50%);z-index:999;padding:.5rem 1rem;background:var(--accent);color:#06121a;border-radius:0 0 8px 8px;font-weight:600;transition:top .2s} .neo-skip:focus{top:0} /* ---------- ANIMATIONS ---------- */ @@ -210,7 +188,6 @@ body::before{ from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} } -.neo-rise{animation:neo-rise .4s ease-out} /* ---------- RESPONSIVE ---------- */ @media(max-width:900px){ diff --git a/assets/js/scroll-to-top.js b/assets/js/scroll-to-top.js new file mode 100644 index 00000000..2f674a2f --- /dev/null +++ b/assets/js/scroll-to-top.js @@ -0,0 +1,13 @@ +// Scroll-to-top button — appears after scrolling 400px, smooth scrolls to top. +(function () { + var btn = document.getElementById('scroll-to-top'); + if (!btn) return; + + var show = function () { btn.classList.toggle('visible', window.scrollY > 400); }; + window.addEventListener('scroll', show, { passive: true }); + show(); + + btn.addEventListener('click', function () { + window.scrollTo({ top: 0, behavior: 'smooth' }); + }); +})(); diff --git a/layouts/404.html b/layouts/404.html index 47639f10..f41f08ac 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,4 +1,49 @@ {{/* Smart 404 — unified design system. + Shows a friendly message, search box, 5 popular posts, and section links. */}} -{{ partial "neo-base.html" . }} + + +{{ partial "neo-head.html" . }} + +{{ partial "neo-header.html" . }} +
+
+

Страница не найдена

+

Возможно, она была перемещена или удалена. Попробуйте поиск или выберите раздел ниже.

+ + {{/* Search box */}} +
+ +
+ + {{/* Popular posts — first 5 blog posts */}} +
+

Популярные записи

+
+ {{ range first 5 (where site.RegularPages "Section" "blog") }} + + {{ .Date.Format "2006-01-02" }} + {{ .Title }} + ⏱ {{ .ReadingTime }} мин + + {{ end }} +
+
+ + {{/* Section links */}} +
+ Блог + Репозитории + Гисты + Граф знаний + Awesome + О сайте + Категории + Теги +
+
+
+{{ partial "neo-footer.html" . }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html index fbec845a..3aa2b17a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1 +1 @@ -{{/*\n List / archive / category-term pages — unified design system.\n*/}}\n\n\n{{ partial "neo-head.html" . }}\n\n{{ partial "neo-header.html" . }}\n
\n
\n

{{ .Title }}

{{ len .Pages }} записей
\n {{ $pages := .Paginate .Pages }}\n \n {{ partial "pagination.html" . }}\n
\n
\n{{ partial "neo-footer.html" . }}\n\n\n \ No newline at end of file +{{/*\n List / archive / category-term pages — unified design system.\n*/}}\n\n\n{{ partial "neo-head.html" . }}\n\n{{ partial "neo-header.html" . }}\n
\n
\n

{{ .Title }}

{{ len .Pages }} записей
\n {{ $pages := .Paginate .Pages }}\n \n {{ partial "pagination.html" . }}\n
\n
\n{{ partial "neo-footer.html" . }}\n\n\n \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 131f5d6b..be1f0856 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,7 +2,7 @@ Single post — unified design system. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/_default/term.html b/layouts/_default/term.html index 4b9e72d7..378a662b 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -2,7 +2,7 @@ Individual taxonomy term page (/categories/media/, /tags/foo/) — Neo (standalone). */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 3c13c83f..6aa7022a 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -3,7 +3,7 @@ Font size scales with mention count so popular tags are visibly larger. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/ai-agents/single.html b/layouts/ai-agents/single.html index 676b818e..135cf7a4 100644 --- a/layouts/ai-agents/single.html +++ b/layouts/ai-agents/single.html @@ -1,6 +1,6 @@ {{/* AI Agents — autonomous agent dashboard. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/ai-features/single.html b/layouts/ai-features/single.html index 8e069640..00f30edc 100644 --- a/layouts/ai-features/single.html +++ b/layouts/ai-features/single.html @@ -1,6 +1,6 @@ {{/* AI Features page — semantic search, recommendations, knowledge graph. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/ai-summary/single.html b/layouts/ai-summary/single.html index 2c9ef4cb..412428c9 100644 --- a/layouts/ai-summary/single.html +++ b/layouts/ai-summary/single.html @@ -1,6 +1,6 @@ {{/* AI Summary — auto-summarize posts with LLM. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/ai/single.html b/layouts/ai/single.html index 98e0df19..971a06e5 100644 --- a/layouts/ai/single.html +++ b/layouts/ai/single.html @@ -1,6 +1,6 @@ {{/* AI Chat — LLM interface with site-aware responses. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/archives/list.html b/layouts/archives/list.html index b08acc81..3c0b81d3 100644 --- a/layouts/archives/list.html +++ b/layouts/archives/list.html @@ -3,7 +3,7 @@ The section itself has no child pages, so we query the blog section. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/bci/single.html b/layouts/bci/single.html index 293f3331..acbbbe8b 100644 --- a/layouts/bci/single.html +++ b/layouts/bci/single.html @@ -1,6 +1,6 @@ {{/* BCI/EEG interface — Web Bluetooth + Muse SDK. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/collab/single.html b/layouts/collab/single.html index 0cfca11c..f10423b3 100644 --- a/layouts/collab/single.html +++ b/layouts/collab/single.html @@ -1,6 +1,6 @@ {{/* Collaborative editor — Yjs + WebRTC P2P. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/contribute/single.html b/layouts/contribute/single.html index 8b9b9ecb..83be7153 100644 --- a/layouts/contribute/single.html +++ b/layouts/contribute/single.html @@ -1,6 +1,6 @@ {{/* Contribution System 2.0 — guest posts, bounties, grants. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/dao/single.html b/layouts/dao/single.html index 9926b0ba..da3da620 100644 --- a/layouts/dao/single.html +++ b/layouts/dao/single.html @@ -1,6 +1,6 @@ {{/* DAO Governance 2.0 — full on-chain governance UI. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/favorites/list.html b/layouts/favorites/list.html index 06fe93e4..8bdd8ad0 100644 --- a/layouts/favorites/list.html +++ b/layouts/favorites/list.html @@ -1,7 +1,7 @@ {{/* Favorites hub — Neo design system (standalone). Client-rendered from localStorage. Sortable (type filter + name), export/import JSON, local analytics, type visualization. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/feature-flags/single.html b/layouts/feature-flags/single.html index e20202da..2ee2a179 100644 --- a/layouts/feature-flags/single.html +++ b/layouts/feature-flags/single.html @@ -1,6 +1,6 @@ {{/* Feature Flags + A/B Testing console. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/feeds/list.html b/layouts/feeds/list.html index 6d1e9eda..17948218 100644 --- a/layouts/feeds/list.html +++ b/layouts/feeds/list.html @@ -1,6 +1,6 @@ {{/* Feeds hub — Neo design system (standalone). Links to RSS + JSON feeds. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/gist/single.html b/layouts/gist/single.html index 067372a6..9289e692 100644 --- a/layouts/gist/single.html +++ b/layouts/gist/single.html @@ -1,6 +1,6 @@ {{/* Single gist — Neo design system (standalone full document) + accentuated card. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/index.html b/layouts/index.html index 88372ffa..7d506dc2 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,7 +2,7 @@ Homepage — unified design system. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} @@ -25,15 +25,28 @@

Инженерный блог
о системах и

Избранное

все посты →
-
- {{ range first 3 $blog }} -
+ {{ $featured := first 3 $blog }} + {{ $lead := index $featured 0 }} + {{ $rest := after 1 $featured }} +
diff --git a/layouts/ipfs-deploy/single.html b/layouts/ipfs-deploy/single.html index 3ae271df..e02015f1 100644 --- a/layouts/ipfs-deploy/single.html +++ b/layouts/ipfs-deploy/single.html @@ -1,6 +1,6 @@ {{/* IPFS-First Hosting — decentralized deploy dashboard. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/neural-interface/single.html b/layouts/neural-interface/single.html index f3fac9b7..b239a5e0 100644 --- a/layouts/neural-interface/single.html +++ b/layouts/neural-interface/single.html @@ -1,6 +1,6 @@ {{/* Direct Neural Interface — thought recognition, brain-to-brain. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/ontology/list.html b/layouts/ontology/list.html index 5e0f1f44..81fbee0a 100644 --- a/layouts/ontology/list.html +++ b/layouts/ontology/list.html @@ -2,7 +2,7 @@ Ontology section list — Neo standalone; renders .Content + taxonomy grids. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/partials/header/basic.html b/layouts/partials/header/basic.html index 2eebbb5a..44d75dd1 100644 --- a/layouts/partials/header/basic.html +++ b/layouts/partials/header/basic.html @@ -30,7 +30,7 @@ {{ .Site.Title | markdownify }} - {{ with .Site.Data.awesome }} + {{ with hugo.Data.awesome }} {{ with .total }} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/partials/neo-head.html b/layouts/partials/neo-head.html index dcf77f9d..a341af30 100644 --- a/layouts/partials/neo-head.html +++ b/layouts/partials/neo-head.html @@ -34,17 +34,25 @@ -{{ $ogImage := "/images/og-default.svg" }} -{{ if .Params.image }}{{ $ogImage = .Params.image }}{{ end }} - +{{ if .IsPage }} + {{ $ogTitle := .Title }} + {{ $ogAuthor := .Params.author | default site.Title }} + {{ $ogBg := "#0b0e14" }} + {{ $ogFg := "#e6eaf2" }} + {{ $ogAccent := "#4fd1c5" }} + {{ $svg := printf `%s%s%s · engineering · systems · data` $ogBg $ogAccent $ogAccent $ogAuthor $ogFg $ogTitle site.Title }} + {{ $ogImage := $svg | resources.FromString (printf "og-images/%s.svg" .File.BaseFileName) | fingerprint }} + + +{{ else }} + + +{{ end }} {{/* Twitter Cards */}} - - -{{/* RSS */}} {{ with .OutputFormats.Get "rss" }}{{ end }} {{/* Critical CSS: inline for first paint */}} diff --git a/layouts/partials/neo-header.html b/layouts/partials/neo-header.html index 298a9056..b169bd8a 100644 --- a/layouts/partials/neo-header.html +++ b/layouts/partials/neo-header.html @@ -61,3 +61,4 @@
+ diff --git a/layouts/projects/list.html b/layouts/projects/list.html index a7872c83..a459b756 100644 --- a/layouts/projects/list.html +++ b/layouts/projects/list.html @@ -2,7 +2,7 @@ Projects section list — Neo standalone; renders .Content (project cards). */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/repository/single.html b/layouts/repository/single.html index 5d953182..a28ef6f1 100644 --- a/layouts/repository/single.html +++ b/layouts/repository/single.html @@ -1,6 +1,6 @@ {{/* Repo detail — Neo design system (standalone full document), matches homepage chrome. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/self-improving-ai/single.html b/layouts/self-improving-ai/single.html index 6d7e43ad..a34a9e85 100644 --- a/layouts/self-improving-ai/single.html +++ b/layouts/self-improving-ai/single.html @@ -1,6 +1,6 @@ {{/* Self-Improving AI — AutoML, model selection, monitoring. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/shortcodes/movie-grid.html b/layouts/shortcodes/movie-grid.html index 3ec11a1e..1db3f7fc 100644 --- a/layouts/shortcodes/movie-grid.html +++ b/layouts/shortcodes/movie-grid.html @@ -1,5 +1,5 @@ {{- /* Renders a responsive movie poster grid from data/movies.json */ -}} -{{- $movies := .Site.Data.movies -}} +{{- $movies := hugo.Data.movies -}}
{{- range $movies -}} {{- $h := mod (mul (len .title) 37) 360 -}} diff --git a/layouts/sitemap/list.html b/layouts/sitemap/list.html index d3d70186..be38b956 100644 --- a/layouts/sitemap/list.html +++ b/layouts/sitemap/list.html @@ -2,7 +2,7 @@ Sitemap section list — Neo standalone HTML sitemap (layout sitemap). */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/social/single.html b/layouts/social/single.html index 091d3b1c..acee588d 100644 --- a/layouts/social/single.html +++ b/layouts/social/single.html @@ -1,6 +1,6 @@ {{/* Social Features — user profiles, activity feed, notifications. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/ssi/single.html b/layouts/ssi/single.html index 3572f74a..382a0d83 100644 --- a/layouts/ssi/single.html +++ b/layouts/ssi/single.html @@ -1,6 +1,6 @@ {{/* Self-Sovereign Identity (SSI) — DID login, verifiable credentials. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/subscribe/single.html b/layouts/subscribe/single.html index d63b1dab..dd5ce5bb 100644 --- a/layouts/subscribe/single.html +++ b/layouts/subscribe/single.html @@ -1,6 +1,6 @@ {{/* Subscribe page — newsletter + referral system. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/layouts/wiki-build/list.html b/layouts/wiki-build/list.html index bf26b0a0..4883043e 100644 --- a/layouts/wiki-build/list.html +++ b/layouts/wiki-build/list.html @@ -2,7 +2,7 @@ Wiki section list — Neo wiki-style (layout wiki-build). Standalone. */}} - + {{ partial "neo-head.html" . }} {{ partial "neo-header.html" . }} diff --git a/playwright.config.js b/playwright.config.js new file mode 100644 index 00000000..75febce3 --- /dev/null +++ b/playwright.config.js @@ -0,0 +1,25 @@ +// Playwright config — visual regression + smoke tests for key pages. +const { defineConfig } = require('@playwright/test'); + +module.exports = defineConfig({ + testDir: './tests/e2e', + timeout: 30000, + retries: 1, + use: { + baseURL: 'http://localhost:1313', + headless: true, + viewport: { width: 1280, height: 800 }, + screenshot: 'on', + trace: 'on-first-retry', + }, + projects: [ + { name: 'desktop', use: { viewport: { width: 1280, height: 800 } } }, + { name: 'mobile', use: { viewport: { width: 375, height: 667 } } }, + ], + webServer: { + command: 'hugo server -p 1313', + port: 1313, + reuseExistingServer: !process.env.CI, + timeout: 60000, + }, +}); diff --git a/tests/e2e/visual-regression.spec.cjs b/tests/e2e/visual-regression.spec.cjs new file mode 100644 index 00000000..ef85fd38 --- /dev/null +++ b/tests/e2e/visual-regression.spec.cjs @@ -0,0 +1,36 @@ +// Visual regression — screenshot key pages in desktop + mobile viewports. +const { test, expect } = require('@playwright/test'); + +const PAGES = [ + { path: '/', name: 'home' }, + { path: '/blog/', name: 'blog' }, + { path: '/about/', name: 'about' }, + { path: '/awesome/', name: 'awesome' }, + { path: '/repositories/', name: 'repositories' }, + { path: '/gists/', name: 'gists' }, + { path: '/knowledge-graph/', name: 'knowledge-graph' }, + { path: '/search/', name: 'search' }, + { path: '/404.html', name: '404' }, +]; + +test.describe('Visual regression', () => { + for (const p of PAGES) { + test(`${p.name} (${p.path}) — no console errors & renders`, async ({ page }) => { + const errors = []; + page.on('console', (msg) => { + if (msg.type() === 'error') errors.push(msg.text()); + }); + const resp = await page.goto(p.path); + expect(resp.status()).toBeLessThan(400); + // Wait for first meaningful paint + await page.waitForLoadState('networkidle'); + // No console errors + expect(errors).toEqual([]); + // Screenshot for visual diff + await expect(page).toHaveScreenshot(`${p.name}.png`, { + fullPage: false, + threshold: 0.2, + }); + }); + } +});