KO
베타 번역

@core / blog

1.0.1 ▾
인증됨MIT
GitHub

@core/content 기반 블로그: 글, 작성자, 카테고리, 태그, 시리즈, 관련 글, 아카이브, RSS/Atom/JSON 피드

코드파일 7개컨텍스트약 554토큰검사 통과

.genpmignore 적용 후 주입될 정확한 트리입니다. 고정 대상:

src/lib/blog/sources.ts읽기 전용 · 8aaf3ee
// Fuentes de sitemap y buscador del blog, y recursos del panel.
import { contentAdminResource, contentSearchSource, contentSitemapSource } from '../content/index.ts';
import { type Doc, toPlainText } from '../rich-text/index.ts';
import { BLOG_COLLECTIONS } from './collections.ts';

type PathFn = (p: { slug: string; locale: string }) => string;
const defaultPath: PathFn = ({ slug }) => `/blog/${slug}`;

export const blogSitemapSource = (path: PathFn = defaultPath) => contentSitemapSource('posts', path);

/** Documentos de búsqueda con el cuerpo en texto plano. Los posts `membersOnly` solo indexan título y extracto. */
export const blogSearchSource = (path: PathFn = defaultPath) =>
  contentSearchSource('posts', {
    type: 'post',
    path,
    title: (d) => String(d.title ?? ''),
    text: (d) => (d.membersOnly ? String(d.excerpt ?? '') : `${d.excerpt ?? ''}\n${toPlainText(d.body as Doc)}`),
  });

/** Recursos del panel: posts (con enlaces "Ver" y "Vista previa"), autores, categorías, etiquetas y series. */
export const blogAdminResources = (path: PathFn = defaultPath) =>
  BLOG_COLLECTIONS.map((c) => ({ ...contentAdminResource(c, c === 'posts' ? { path } : {}), group: 'Blog' }));

@core/blog 신고

패키지를 신고하려면 GitHub로 로그인하세요.