Proposal: Curated Home Page Layout for DocC Archives (Hero + Top-Level Cards)
I opened a PR (Added Documentation homepage by VictorPuga · Pull Request #982 · swiftlang/swift-docc-render · GitHub) with this approach and was asked to start a forums thread to discuss it further; this post summarizes the proposal and open questions.
Context / Motivation
- Pain point: Today
/defaults to a “not found” page and doesn’t highlight the most important entry points (documentation and tutorials). - Goal: Provide a clear, modern landing experience—hero plus concise top-level navigation—so readers can immediately choose between primary documentation areas.
What this change delivers
- A
/landing page modeled on Featured | Apple Developer Documentation with a centered hero, plus card grids for top-level documentation and tutorials. - Cards and sidebar show only root nodes.
How it works
- Reuses the existing
DocumentationLayoutandNavigatordata, filtered to the top-level nodes of the sidebar tree. - Uses existing TopicType metadata to choose icons; no extra content authoring required.
- Hero strings come from new i18n keys; colors/shadows use existing theme tokens.
- Routing remains the same: the home page is still
/.
Comparison to merged/combined archives
I checked merged archives recently, and these are the key points:
- They provide a similar experience to this PR, but the merged view currently lives at
/documentationinstead of/. - This proposal does not require a combined archive (
--enable-experimental-combined-documentation). It uses the same DocC-generated index output and presents it with a curated hero + cards at the root. - It intentionally renders only the top-level nodes (like the merged archive index), keeping the landing page focused and uncluttered.
Customization surface
The current PR does not expose customization knobs yet; open to which options (hero text overrides, grid breakpoints, icon set, etc.) should be configurable and whether they belong in this renderer or in DocC itself.
Open questions for the community
- Do we want this as an opt-in template, a default, or a theme toggle?
- If we add customization, should those controls live in DocC itself or in the renderer layer?
- Given that combined archives already exist, does it make sense to add this landing page? If so, what differentiating features should it include?
Looking forward to feedback and to aligning this with DocC’s roadmap.