bpmore / statamic-constellation
An interactive map of your site's internal link structure.
Package info
github.com/bpmore/constellation
Type:statamic-addon
pkg:composer/bpmore/statamic-constellation
Requires
- php: ^8.3
- statamic/cms: ^6.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.8 || ^11.0
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
An interactive map of your Statamic site's internal link structure.
Constellation reads the links your authors actually wrote, in Bard fields, Link fields, relationship fields, and markdown, and draws every page as a node with those links between them. It tells you which pages nothing links to, which pages lead nowhere, how many clicks each page sits from home, and where the islands are. It shows the same data as a sortable, searchable table, because that is where the work gets done.
Free. Statamic 6. No crawling, no rendering, no opinions about what you should link to next.
What it answers
- What is orphaned? Pages with no inbound editorial link and no place in any navigation.
- What is a dead end? Pages that link nowhere onward.
- What is buried? Click depth from the home page, measured across content links and navigation.
- What is load-bearing? A hub score, PageRank-style, so the page everything quietly depends on stands out.
- Where are the islands? Connected components, so clusters of content that never touch the rest of the site show up as clusters.
What it deliberately does not do
Constellation describes structure. It does not suggest links to add and it does not check for broken links. Those are different products with different jobs, and staying out of them keeps this one small. It also does not crawl rendered pages, because a global navigation and footer would connect every page to every other page and the map would say nothing.
Requirements
- Statamic 6
- PHP 8.3 or newer
- A database. The map is stored in three tables, one build at a time, so the control panel never has to compute anything while you wait.
Install
composer require bpmore/statamic-constellation php artisan migrate
Then build the map:
php please constellation:build
Open Utilities → Constellation in the control panel.
Commands
php please constellation:build [--site=] [--collection=] [--queue] php please constellation:orphans [--site=] [--format=table|csv] php please constellation:prune [--site=] [--keep=2]
build reads every entry in the site and writes a new run. It never renders a page, so it is cheap enough to schedule weekly. On a large site pass --queue to build on a queue worker; the command prints a hint when a site is big enough for that to matter.
orphans lists the pages nothing links to, from the last completed build. --format=csv writes something a spreadsheet can open:
site,collection,title,url,out_degree
default,articles,Old post nobody links to,/blog/old-post-nobody-links-to,0
prune keeps the two newest completed builds per site and deletes the rest. A weekly build on a large site adds a few hundred thousand rows each time, so schedule this too.
A reasonable schedule, in routes/console.php:
Schedule::command('constellation:build --queue')->weekly(); Schedule::command('constellation:prune')->weekly();
The control panel screen
Two tabs, given equal billing.
Map. Every page drawn as a node, sized by how many pages link to it and coloured by collection. Orphaned pages are drawn as a square with a ring, never by colour alone, so the marking survives greyscale, printing and every kind of colour blindness. Hover a page for its numbers. Click one to open it. Type a title to find and centre it. Narrow to a collection, to orphans, to dead ends, or to pages within a few clicks of home. Download the picture as PNG or SVG with the site, date and page count on it.
Table. The same data as a list: page, collection, inbound links, outbound links, depth, status. Sort any column. Search titles and URLs. Filter by collection. Two saved filters, Orphans and Dead ends, are the lists people actually work down.
Every view is a URL. Bookmark a filtered table, send a colleague the orphan list, reload after fixing a page.
Entry sidebar. Open any entry and the sidebar says how many pages link to it and how many it links to, with a flag if it is orphaned or a dead end. No blueprint changes needed.
Accessibility
The table is not a fallback for the map. It is a first-class peer with the same data, rendered on the server with real headings, real links and real form controls. It works with a keyboard, with a screen reader, and with JavaScript off.
The map has a described summary, "44 pages, 4 orphaned, 7 clusters", and every page in it also exists as a real link in a list beside the canvas. Tab moves between pages, the arrow keys move to a linked page, Enter opens one. Each link has an accessible name with the same facts the hover card shows.
prefers-reduced-motion is respected. There is no force simulation in the browser to begin with, because the layout is settled on the server, so the map appears in its final position on the first frame for everyone. With the preference set, the camera also stops gliding and jumps instead.
Both control panel themes are supported.
How links are found
Constellation reads stored field values, never rendered HTML, and it reads them raw rather than through augmentation, because augmentation resolves an internal reference into a URL and throws away the id.
| Source | Stored as | Edge type |
|---|---|---|
| Bard link marks | statamic://entry::{id} |
bard |
| Link fieldtype | entry::{id}, @child, or a URL |
link_field |
| Entries fieldtype | bare ids | relation |
| Markdown and HTML fields | [text](/path) and <a href> |
markdown |
| Navigation trees | nav |
|
| Collection page trees | structure |
Bard and the Link fieldtype store the same reference in two different forms, and both live side by side in the same entry. Fields nested inside replicators, grids and Bard sets are found. A save_html Bard field is read as HTML and still carries its statamic:// references.
Navigation and page-tree edges are stored and used for the orphan check, but they are not drawn by default and they do not count towards a page's inbound number. Being in the main menu is not somebody linking to you.
A plain URL like /about is resolved back to an entry within the same site, including the site's URL prefix on a multisite install. Links to other hosts, other sites, mailto:, tel:, and page-relative paths like ../about are not resolved.
Multisite
One map per site. Cross-site links are recorded during extraction and dropped at build time, since they have no node to attach to in that site's graph.
Permissions
Statamic registers access constellation utility for the screen, the same way it does for every utility. Constellation adds view constellation, which controls whether a user sees link counts in the entry sidebar. Grant both to anyone who should see the map.
Scale
The build holds a site's nodes and edges in memory and the map draws at most 5,000 nodes at once. Above that it says so and offers a collection filter or the table, which handles any number of pages. Layout positions are seeded from the previous build, so a rebuild moves pages locally rather than reshuffling the whole map.
Reading the data yourself
The three tables are a plain, documented snapshot: constellation_runs, constellation_nodes keyed by entry id with every metric, and constellation_edges keyed by entry ids with a type and a weight. They are designed to be read by other tools without recomputation.
Development
composer install
npm install
vendor/bin/pest
npm test
npm run build
Tests run on PHP 8.3 and 8.4, which is exactly the supported range.
License
MIT.

