Skip to content

Site Discovery

This page is generated from public package documentation in capell-4/packages and the package manifest checked into the source repository.

FieldValue
Composer packagecapell-app/site-discovery
Package slugsite-discovery
Product groupCapell Search & SEO
Tierpremium
Bundlesearch-seo
Runtime contextsadmin, frontend, console
Capell version^4.0
Source repositorycapell-app/packages
Source pathpackages/site-discovery
Docs sourcepackages/site-discovery/docs
Manifestcapell.json

Site Discovery owns public sitemap and discoverability output for Capell sites.

  • Package: capell-app/site-discovery
  • Namespace: Capell\SiteDiscovery\
  • Surfaces: admin actions/tools, frontend sitemap pages, console
  • Service providers: packages/site-discovery/src/Providers/SiteDiscoveryServiceProvider.php
  • Capell dependencies: capell-app/admin, capell-app/core, capell-app/frontend
  • Third-party dependencies: icamys/php-sitemap-generator
  • Resolves public discoverable pages and URLs, then exposes HTML and XML sitemap outputs.
  • Provides a discovery-output contract so packages can advertise public machine-readable outputs such as llms.txt without coupling Site Discovery to consumer packages.
  • Provides a URL change notification contract so packages can submit public URL changes to IndexNow-style services without hard-coding providers into sitemap generation.
  • Includes an optional IndexNow notifier, disabled by default until capell-site-discovery.indexnow.enabled and a key are configured.
  • Helps owners and search tools find the pages Capell intends to publish without each package building its own crawler view.
  • Gives developers a shared discovery surface that SEO Suite, Blog, Search, and audits can use consistently.
  • Public discoverable page and URL APIs.
  • HTML sitemap page type and frontend component.
  • XML sitemap generation with chunking and incremental state.
  • Sitemap admin page, admin actions, and generation tool.
  • Lifecycle listeners that regenerate sitemap output when pages or sites change.
AreaPathPurpose
Actionspackages/site-discovery/src/ActionsDomain operations. Test these directly where possible.
Datapackages/site-discovery/src/DataStructured payloads, form state, view models, and integration data.
Enumspackages/site-discovery/src/EnumsPersisted states and Filament option values.
Filamentpackages/site-discovery/src/FilamentAdmin resources, pages, widgets, and settings UI.
Livewirepackages/site-discovery/src/LivewireInteractive frontend or admin components.
Providerspackages/site-discovery/src/ProvidersRegistration, extension hooks, routes, migrations, and resources.
Resourcespackages/site-discovery/resourcesViews, translations, assets, and package resources.
Testspackages/site-discovery/testsPackage-level Pest coverage.
  • Admin: Page and Site Sitemap actions, plus the sitemap generation tool.
  • Frontend: /sitemap HTML sitemap and /sitemap-xml XML response.
  • Livewire: Sitemap, SitemapTool.
  • capell:xml-sitemap {--site= : Only regenerate sitemaps for this site ID} {--incremental : Skip domains whose pages have not changed since the last run} (packages/site-discovery/src/Console/Commands/XmlSitemapCommand.php)
  • Data objects live in src/Data/; use them for payloads, form state, and view models.
  • PagesSitemap caches serialized page arrays and rebuilds SitemapPageData objects when reading from cache. Do not cache the DTO objects directly; stale serialized objects can come back as __PHP_Incomplete_Class in host apps.
  • Contracts: DiscoverableUrlSource, DiscoveryOutputSource, UrlChangeNotifier, Sitemapable.
  • IndexNow: enable capell-site-discovery.indexnow.enabled and set capell-site-discovery.indexnow.key to submit URL changes through the built-in notifier.
  • Listeners: RegenerateSitemapsOnPageDeleted, RegenerateSitemapsOnPageSaved, RegenerateSitemapsOnSiteCreated.
  • Register Capell extension points, routes, migrations, settings, render hooks, and resources from service providers.
  • Install with composer require capell-app/site-discovery in the host Capell application.
  • The core install flow can create the default Sitemap page when this package is installed before capell:install.
  • When adding the package to an existing core-only app, create the Sitemap page for each existing site before testing /sitemap; the current extension install flow does not backfill existing sites automatically.
  • In this repository, verify package changes with vendor/bin/pest; do not use php artisan.

The package screenshot contract covers the package-added Page and Site sitemap actions, the sitemap generation tool, /sitemap, and /sitemap-xml. Keep each capture focused on the added surface; avoid broad admin screenshots that hide which control belongs to this package.

Public sitemap screenshots should be checked for authoring or package identifiers. The public output must not expose capell-site-discovery, capell-sitemap, admin URLs, editor metadata, signed editor links, or unpublished pages.

Run package tests from the repository root:

Terminal window
vendor/bin/pest packages/site-discovery/tests --configuration=phpunit.xml
  • Put behaviour changes in src/Actions/; UI classes, commands, and controllers should call actions instead of owning domain logic.
  • Use package Data classes at boundaries instead of passing anonymous arrays between layers.
  • Use backed enums for persisted values and enum labels for Filament options.