KO
베타 번역

@core / seo

1.0.0 ▾
인증됨MIT
GitHub

GenPM 사이트 SEO: canonical·hreflang 메타데이터, 분할 사이트맵, robots.txt, llms.txt, 안전한 JSON-LD

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

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

src/lib/seo/adapters/hono.ts읽기 전용 · cf4e3c3
// Adaptador Hono: `app.route('/', seoRoutes())` → /sitemap.xml, /sitemaps/:name/:n.xml y /robots.txt.
import { Hono } from 'hono';
import { robotsTxt, sitemapChunkXml, sitemapIndexXml } from '../index.ts';

const XML = { 'content-type': 'application/xml; charset=utf-8', 'cache-control': 'public, max-age=3600' };

export function seoRoutes(opts: { disallow?: string[] } = {}) {
  return new Hono()
    .get('/sitemap.xml', async (c) => c.body(await sitemapIndexXml(), 200, XML))
    .get('/sitemaps/:name/:file', async (c) => {
      const m = /^(\d{1,4})\.xml$/.exec(c.req.param('file'));
      const body = m ? await sitemapChunkXml(c.req.param('name'), Number(m[1])) : null;
      return body ? c.body(body, 200, XML) : c.notFound();
    })
    .get('/robots.txt', (c) => c.text(robotsTxt(opts)));
}

@core/seo 신고

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