Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/backend/PkgDiff.API/Controllers/SitemapController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using PkgDiff.Application.Interfaces;
using PkgDiff.Shared.Constants;

namespace PkgDiff.API.Controllers;

Expand All @@ -25,6 +24,9 @@ public class SitemapController : ControllerBase
"/cookies",
};

// The values used in public URLs, where pub.dev is "pub"
private static readonly string[] RegistryHubs = { "nuget", "npm", "pypi", "pub", "packagist", "maven" };

private readonly IAdminPackageService _adminService;
private readonly IMemoryCache _memory;
private readonly ILogger<SitemapController> _logger;
Expand Down Expand Up @@ -73,7 +75,7 @@ private async Task<string> BuildSitemapAsync()
AppendUrl(xml, path, null);
}

foreach (var registry in RegistryNames.All)
foreach (var registry in RegistryHubs)
{
AppendUrl(xml, $"/packages?registry={registry}", null);
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/public/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pkgdiff helps developers decide whether a dependency upgrade is safe. It combine
- [npm packages](https://pkgdiff.dev/packages?registry=npm)
- [PyPI packages](https://pkgdiff.dev/packages?registry=pypi)
- [Maven packages](https://pkgdiff.dev/packages?registry=maven)
- [pub.dev packages](https://pkgdiff.dev/packages?registry=pub.dev)
- [pub.dev packages](https://pkgdiff.dev/packages?registry=pub)
- [Packagist packages](https://pkgdiff.dev/packages?registry=packagist)

## Package pages
Expand Down
8 changes: 6 additions & 2 deletions src/frontend/src/app/features/packages/packages-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const REGISTRY_LABELS: Record<string, string> = {
npm: 'npm',
pypi: 'PyPI',
maven: 'Maven',
'pub.dev': 'pub.dev',
pub: 'pub.dev',
packagist: 'Packagist',
};

const REGISTRY_ALIASES: Record<string, string> = {
pub: 'pub.dev',
'pub.dev': 'pub',
composer: 'packagist',
};

Expand Down Expand Up @@ -259,5 +259,9 @@ export class PackagesListComponent {
: 'Browse packages from NuGet, npm, PyPI, Maven, pub.dev and Packagist. See version history, breaking changes and categorized release notes.',
url: query ? `/packages?${query}` : '/packages',
});

if (!this.isLoading() && this.registryPackages().length === 0) {
this.seo.setNoIndex();
}
}
}