feat: add dynamic sitemap for Google Search Console indexing

- Generate sitemap.xml with all skill URLs for search engine discovery
- Return empty sitemap on mirror servers to prevent duplicate indexing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
airano
2026-02-12 18:47:16 +03:30
parent 756432d9de
commit 83a3766838
2 changed files with 150 additions and 0 deletions

View File

@@ -399,6 +399,20 @@ export const skillQueries = {
return result[0]?.count ?? 0;
},
/**
* Get all skills for sitemap generation (lightweight: id, updatedAt, githubOwner only)
*/
getAllForSitemap: async (db: DB) => {
return db
.select({
id: skills.id,
updatedAt: skills.updatedAt,
githubOwner: skills.githubOwner,
})
.from(skills)
.where(and(eq(skills.isBlocked, false), eq(skills.sourceFormat, 'skill.md')));
},
/**
* Get site engagement level for adaptive algorithm
* Returns: 'cold_start' | 'growth' | 'mature'