EN

@core / kit-blog

1.0.1 ▾
verifiedMIT
GitHub

Blog kit for Next.js: posts with authors, categories, tags, series, feeds, moderated comments and newsletter

Code32 filesContext~883 tokensscan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/app/(blog)/_lib/paths.tsread-only · fa952a4
// Rutas y utilidades puras del blog (sin registro: las importa también el bloque "Últimos posts").
export const BLOG_PATH = '/blog';
export const PER_PAGE = 10;
export const postPath = (p: { slug: string }) => `${BLOG_PATH}/${p.slug}`;

/** Página pedida en `?page=` (1 si falta o no es válida). */
export function pageParam(sp: Record<string, string | string[] | undefined>): number {
  const v = Number(Array.isArray(sp.page) ? sp.page[0] : sp.page);
  return Number.isInteger(v) && v > 0 && v < 10_000 ? v : 1;
}

export const formatDate = (d: Date | null, locale = 'en') =>
  d ? new Intl.DateTimeFormat(locale, { dateStyle: 'long', timeZone: 'UTC' }).format(d) : '';

Report @core/kit-blog

Sign in with GitHub to report a package.