📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -40,6 +40,16 @@ function normalizeSkillId(skillId) {
|
||||
return encodeURIComponent(String(skillId).trim());
|
||||
}
|
||||
|
||||
function toIndexableRoutePath(pathName) {
|
||||
const normalized = String(pathName || '/').trim();
|
||||
if (!normalized || normalized === '/') {
|
||||
return '/';
|
||||
}
|
||||
|
||||
const withLeadingSlash = normalized.startsWith('/') ? normalized : `/${normalized}`;
|
||||
return withLeadingSlash.endsWith('/') ? withLeadingSlash : `${withLeadingSlash}/`;
|
||||
}
|
||||
|
||||
export function selectTopSkillEntries(skills, topCount = TOP_SKILL_COUNT) {
|
||||
const max = Math.max(Number.parseInt(topCount, 10) || 0, 0);
|
||||
if (!Array.isArray(skills) || max === 0) {
|
||||
@@ -97,12 +107,12 @@ export function getSeoLandingPaths() {
|
||||
return pages
|
||||
.map((page) => String(page?.slug || '').trim())
|
||||
.filter(Boolean)
|
||||
.map((slug) => `/topics/${encodeURIComponent(slug)}`);
|
||||
.map((slug) => toIndexableRoutePath(`/topics/${encodeURIComponent(slug)}`));
|
||||
}
|
||||
|
||||
export function generateSitemapXml({ baseUrl, paths, lastmod = DEFAULT_LASTMOD }) {
|
||||
const normalizedBase = String(baseUrl).replace(/\/$/, '');
|
||||
const uniquePaths = [...new Set(paths)];
|
||||
const uniquePaths = [...new Set(paths.map(toIndexableRoutePath))];
|
||||
|
||||
const urlsXml = uniquePaths
|
||||
.map((pathName) => {
|
||||
@@ -128,7 +138,7 @@ export function buildSitemap(skills, topCount = TOP_SKILL_COUNT, baseUrl = SITE_
|
||||
const landingPaths = getSeoLandingPaths();
|
||||
return generateSitemapXml({
|
||||
baseUrl,
|
||||
paths: ['/', '/plugins', ...landingPaths, ...topSkillPaths],
|
||||
paths: ['/', toIndexableRoutePath('/plugins'), ...landingPaths, ...topSkillPaths.map(toIndexableRoutePath)],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ describe('sitemap generation script helpers', () => {
|
||||
const xml = buildSitemap(catalog, 1, 'https://example.com');
|
||||
|
||||
expect(xml).toContain('https://example.com/</loc>');
|
||||
expect(xml).toContain('https://example.com/topics/antigravity-cli-skills</loc>');
|
||||
expect(xml).toContain('https://example.com/skill/gamma</loc>');
|
||||
expect(xml).toContain('https://example.com/topics/antigravity-cli-skills/</loc>');
|
||||
expect(xml).toContain('https://example.com/skill/gamma/</loc>');
|
||||
expect(xml).not.toContain('/skill/delta');
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('sitemap generation script helpers', () => {
|
||||
const xml = buildSitemap(catalog, 1, 'https://example.com/search?q=ai&lang=en');
|
||||
|
||||
expect(xml).toContain('https://example.com/search?q=ai&lang=en/</loc>');
|
||||
expect(xml).toContain('/safe%26id</loc>');
|
||||
expect(xml).toContain('/safe%26id/</loc>');
|
||||
});
|
||||
|
||||
it('returns homepage and topic routes when top skill limit is zero', () => {
|
||||
@@ -46,17 +46,17 @@ describe('sitemap generation script helpers', () => {
|
||||
const xml = buildSitemap(catalog, 0, 'https://example.com');
|
||||
|
||||
expect(xml).toContain('https://example.com/</loc>');
|
||||
expect(xml).toContain('https://example.com/topics/github-ai-skills-repository</loc>');
|
||||
expect(xml).toContain('https://example.com/topics/github-ai-skills-repository/</loc>');
|
||||
expect(xml).not.toContain('https://example.com/skill');
|
||||
});
|
||||
|
||||
it('loads stable SEO landing paths from shared catalog data', () => {
|
||||
expect(getSeoLandingPaths()).toEqual(
|
||||
expect.arrayContaining([
|
||||
'/topics/antigravity-cli-skills',
|
||||
'/topics/github-ai-skills-repository',
|
||||
'/topics/antigravity-plugins',
|
||||
'/topics/skills-para-antigravity',
|
||||
'/topics/antigravity-cli-skills/',
|
||||
'/topics/github-ai-skills-repository/',
|
||||
'/topics/antigravity-plugins/',
|
||||
'/topics/skills-para-antigravity/',
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ const TEMPLATE_PATH = path.join(DIST_DIR, 'index.html');
|
||||
const SKILLS_PATH = path.join(PUBLIC_DIR, 'skills.json');
|
||||
const SEO_LANDING_PAGES_PATH = path.join(ROOT_DIR, 'src', 'data', 'seoLandingPages.json');
|
||||
|
||||
const HOME_CATALOG_COUNT_FALLBACK = 1894;
|
||||
const HOME_CATALOG_COUNT_FALLBACK = 1898;
|
||||
const PRERENDER_SOCIAL_IMAGE = 'social-card.svg';
|
||||
const SITE_NAME = 'Antigravity Awesome Skills';
|
||||
const REPOSITORY_URL = 'https://github.com/sickn33/antigravity-awesome-skills';
|
||||
@@ -76,7 +76,10 @@ function normalizeRoute(routePath) {
|
||||
function routeToUrl(routePath, siteBaseUrl) {
|
||||
const normalizedRoute = normalizeRoute(routePath);
|
||||
const normalizedBase = siteBaseUrl.replace(/\/+$/, '');
|
||||
return `${normalizedBase}${normalizedRoute}`;
|
||||
const indexableRoute = normalizedRoute === '/' || normalizedRoute.endsWith('/')
|
||||
? normalizedRoute
|
||||
: `${normalizedRoute}/`;
|
||||
return `${normalizedBase}${indexableRoute}`;
|
||||
}
|
||||
|
||||
function routeToFilePath(routePath) {
|
||||
|
||||
@@ -40,10 +40,10 @@ describe('seo assets verification helpers', () => {
|
||||
const xml = `
|
||||
<urlset>
|
||||
<url><loc>https://owner.github.io/repo/</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/plugins</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/topics/antigravity-cli-skills</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/skill/agent-a</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/skill/agent-b</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/plugins/</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/topics/antigravity-cli-skills/</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/skill/agent-a/</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/skill/agent-b/</loc></url>
|
||||
</urlset>
|
||||
`;
|
||||
|
||||
@@ -247,13 +247,13 @@ describe('seo assets verification helpers', () => {
|
||||
fs.mkdirSync(path.dirname(routeFile), { recursive: true });
|
||||
fs.writeFileSync(
|
||||
routeFile,
|
||||
'<html><head><title>Antigravity CLI Skills | Installable AI agent playbooks</title><meta name="description" content="Install Antigravity CLI skills from the GitHub repository." /><meta property="og:title" content="Antigravity CLI Skills" /><script type="application/ld+json">[{"@context":"https://schema.org","@type":"WebPage"},{"@context":"https://schema.org","@type":"BreadcrumbList"},{"@context":"https://schema.org","@type":"Organization"},{"@context":"https://schema.org","@type":"WebSite"},{"@context":"https://schema.org","@type":"SoftwareSourceCode"}]</script></head><body><div id="root"><main data-prerender-fallback="true"><a href="https://owner.github.io/repo/topics/github-ai-skills-repository">A GitHub repository for installable AI agent skills</a></main></div></body></html>',
|
||||
'<html><head><title>Antigravity CLI Skills | Installable AI agent playbooks</title><meta name="description" content="Install Antigravity CLI skills from the GitHub repository." /><meta property="og:title" content="Antigravity CLI Skills" /><script type="application/ld+json">[{"@context":"https://schema.org","@type":"WebPage"},{"@context":"https://schema.org","@type":"BreadcrumbList"},{"@context":"https://schema.org","@type":"Organization"},{"@context":"https://schema.org","@type":"WebSite"},{"@context":"https://schema.org","@type":"SoftwareSourceCode"}]</script></head><body><div id="root"><main data-prerender-fallback="true"><a href="https://owner.github.io/repo/topics/github-ai-skills-repository/">A GitHub repository for installable AI agent skills</a></main></div></body></html>',
|
||||
);
|
||||
|
||||
const xml = `
|
||||
<urlset>
|
||||
<url><loc>https://owner.github.io/repo/</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/topics/antigravity-cli-skills</loc></url>
|
||||
<url><loc>https://owner.github.io/repo/topics/antigravity-cli-skills/</loc></url>
|
||||
</urlset>
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user