Revert "[fix] solution/site: 사이트맵 lastmod 를 파일 mtime 에서 뗀다 — 페이지의 dateModified 를 그대로 쓴다"

This reverts commit 09b0538c9c.
This commit is contained in:
minaChoi committed 2026-09-07 13:33:34 +09:00
1 parent b797535b17
commit de5ff5186f
4 files changed
+18 -122

No files matched your search

-32
View File
@@ -9,38 +9,6 @@ export interface DirectoryEntry {
lastmod?: string;
}
/**
* 구운 `index.html` 에서 `<title>` 만 꺼낸다. 파서를 붙일 값어치가 없는 한 줄짜리 일이다.
*
* ★ 왜 payload 가 아니라 구운 HTML 을 읽나 — 발행은 **바뀐 사이트 하나만** 굽는다.
* 이번 실행분으로만 목록을 만들면 나머지 사이트가 목록에서 사라진다.
*/
export function readBakedTitle(html: string): string {
const match = /<title>([^<]*)<\/title>/.exec(html);
return match ? match[1].trim() : '';
}
/**
* 사이트맵 `lastmod` — **페이지가 스스로 선언한 `dateModified` 를 그대로** 쓴다.
*
* ★ 파일 mtime 을 쓰면 안 된다(예전 구현). 렌더러를 배포하면 번들 해시가 바뀌어 내용이
* 같은 사이트까지 전부 다시 구워진다 — mtime 은 그때마다 오늘이 되고, 사이트맵은
* **"전 사이트가 오늘 갱신됨"** 을 통보한다. 구글은 lastmod 를 페이지의 실제 수정과
* 대조해 맞을 때만 쓰고 어긋나면 그 필드를 **아예 무시한다**(Search Central: "the date and
* time of the last significant update" · "consistently and verifiably accurate").
* 즉 이 오염은 사장님이 **진짜로** 내용을 고쳐 재발행한 날의 신호까지 같이 죽인다.
*
* ★ head.ts 의 `dateModified` 메타와 **같은 값**을 읽는다 — 구글이 대조하는 그 값이라
* 사이트맵과 페이지가 어긋날 수 없다. head.ts 가 이 태그를 바꾸면 여기도 같이 고친다
* (directory.test.ts 가 그 커플링을 고정해 둔다).
*/
export function readBakedLastmod(html: string): string | undefined {
const match = /<meta name="dateModified" content="([^"]*)"/.exec(html);
const value = match?.[1].trim();
// 값이 깨졌으면 넣지 않는다 — 틀린 lastmod 는 없는 것보다 나쁘다(위 ★ 참조).
return value && !Number.isNaN(Date.parse(value)) ? value : undefined;
}
/**
* `/s/` 발행 사이트 목록 페이지.
*