Prepare V2 corpus, editorial journal and reproducible publication boundary

This commit is contained in:
huncode committed 2026-10-26 17:46:00 +03:00
1 parent 7b3f49788d
commit 69607c52fd
498 files changed
+97671 -468

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
"use client";
import {useState} from 'react';
import {useState,useEffect} from 'react';
import Link from 'next/link';
export default function Catalog({articles}){const [q,setQ]=useState(''),[topic,setTopic]=useState('Все');const topics=['Все',...new Set(articles.flatMap(a=>a.categories))];const shown=articles.filter(a=>(topic==='Все'||a.categories.includes(topic))&&(a.title+' '+a.excerpt+' '+a.categories.join(' ')).toLocaleLowerCase('ru').includes(q.toLocaleLowerCase('ru')));return <section id="catalog" className="articles-shell"><div className="articles-header"><div><p className="eyebrow">Восстановленные публикации</p><h2>Архив заметок</h2></div><span>{shown.length} из {articles.length}</span></div><div className="filters"><label htmlFor="search">Поиск по заголовкам и описаниям</label><input id="search" type="search" value={q} onChange={e=>setQ(e.target.value)} placeholder="Например: Bitrix, D, сертификат"/><div className="topics">{topics.map(t=><button aria-pressed={topic===t} key={t} onClick={()=>setTopic(t)}>{t}</button>)}</div></div><p aria-live="polite" className="result-count">{shown.length ? `Найдено: ${shown.length}`:'Ничего не найдено. Попробуйте другой запрос или тему.'}</p><div className="article-grid">{shown.map(a=><Link className="article-card" key={a.slug} href={'/articles/'+encodeURIComponent(a.slug)+'/'}><div className="card-topic">{a.categories[0]} <span>↗</span></div><div className="article-card__body"><div className="meta-line"><time dateTime={a.date}>{new Intl.DateTimeFormat('ru-RU',{year:'numeric',month:'long',day:'numeric',timeZone:'UTC'}).format(new Date(a.date))}</time><span>{a.readingMinutes} мин</span></div><h3>{a.title}</h3><p>{a.excerpt.slice(0,170)}…</p></div></Link>)}</div></section>}
export default function Catalog({articles}){const [q,setQ]=useState(''),[topic,setTopic]=useState('Все');const topics=['Все',...new Set(articles.flatMap(a=>a.categories))];const shown=articles.filter(a=>(topic==='Все'||a.categories.includes(topic))&&(a.title+' '+a.excerpt+' '+a.categories.join(' ')).toLocaleLowerCase('ru').includes(q.toLocaleLowerCase('ru')));return <section id="journal" className="journal"><div className="journal-heading"><div><p className="kicker">ПОЛНЫЙ ИНДЕКС</p><h2>Статьи и заметки</h2></div><span>{articles.length} материалов</span></div><div className="catalog-controls"><label htmlFor="search"><span>Найти в журнале</span><input id="search" type="search" value={q} onChange={e=>setQ(e.target.value)} placeholder="Тема, язык или задача"/></label><div className="topic-tabs" aria-label="Темы">{topics.map(t=><button aria-pressed={topic===t} key={t} onClick={()=>setTopic(t)}>{t}</button>)}</div></div><p role="status" className="search-status">{shown.length?`Найдено материалов: ${shown.length}`:'По этому запросу ничего нет. Попробуйте другое слово или сбросьте тему.'}</p><div className="journal-list">{shown.map(a=><article key={a.slug} className="index-entry"><div className="index-date"><time dateTime={a.date}>{new Intl.DateTimeFormat('ru-RU',{year:'numeric',month:'short',day:'numeric',timeZone:'UTC'}).format(new Date(a.date))}</time><span>{a.categories.join(' · ')}</span></div><Link href={'/articles/'+encodeURIComponent(a.slug)+'/'}><h3>{a.title}</h3><p>{a.excerpt}</p></Link><span className="index-duration">{a.readingMinutes} мин <b aria-hidden="true">↗</b></span></article>)}</div>{!shown.length&&<button onClick={()=>{setQ('');setTopic('Все');}}>Сбросить поиск</button>}</section>}