# Improving the User Experience at the Documentation Archive Index

**URL:** <https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433>\
**Category:** Swift Documentation Tooling\
**Tags:** docc-render\
**Created:** [May 2, 2026, 5:09pm UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433 "2026-05-02T17:09:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![victorpuga](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/victorpuga/32/46421_2.png) [@victorpuga](https://forums.swift.org/u/victorpuga)\
**Post date:** [May 2, 2026, 5:09pm UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/1 "2026-05-02T17:09:32Z")

</div>

_This is a follow up to the conversation in [Documentation Homepage](https://forums.swift.org/t/documentation-homepage/83704)_

## Problem Statement

Today, when users visit the root `/` of a DocC archive, they encounter a "soft 404" error page. This creates a poor first impression and doesn't guide visitors toward the actual documentation they're looking for.

For example, visiting `https://docs.swift.org/swiftpm/` shows an error, when ideally it should provide a clear landing experience that orients the user and directs them to the documentation modules and tutorials available in that archive.

## Why This Matters

The documentation homepage is often the first touchpoint for users discovering a library or framework. A poor experience at this critical moment can:

- Frustrate new users and developers
- Reduce discoverability of important documentation
- Create confusion about whether documentation even exists
- Contrast sharply with modern developer documentation sites (like Apple's Developer Docs)

## Proposed Solution

Instead of a 404, the archive index at `/` should display:

- A clear heading or hero section introducing the archive
- A sidebar showing the top-level navigation structure
- Direct links to the primary modules, tutorials, and documentation sections

This can be achieved by leveraging the existing navigator data that DocC already generates, without requiring new output files or changes to existing routes.

 ![Proposed solution image](https://global.discourse-cdn.com/swift/original/3X/9/6/9632ad7a58dd52da37a5f2bb949f2f8d71153895.jpeg)

## Interoperability with Merged Archives

This proposal is fully compatible with DocC's merged documentation feature. We're only creating a landing page at `/`, while leaving the existing `/documentation` route intact. This means:

- Merged archives continue to work as expected
- The root landing page complements rather than conflicts with combined documentation
- No changes needed to existing merged archive configurations

Looking forward to your thoughts and suggestions!

> <https://github.com/swiftlang/swift-docc-render/pull/982>
>
> \## Summary
> 
> \### What this change addresses / expected UX
> Adds a home (/ ) exp…erience inspired by https://developer.apple.com/documentation: a centered hero plus two card grids for top-level documentation and tutorials. Users now land on a concise, styled index that matches the sidebar’s top-level navigation (only roots, with proper icons), hides empty sections, and adapts to light/dark themes.
> 
> Before
> 
> \<img width="1588" height="1064" alt="Screenshot 2025-12-07 at 2 47 31 p m" src="https://github.com/user-attachments/assets/d95f608f-896f-43b4-b497-8117546b58ed" /\>
> 
> After
> 
> \<img width="1588" height="1064" alt="Screenshot 2025-12-07 at 2 24 30 p m" src="https://github.com/user-attachments/assets/9df0dd65-65b1-4eec-bf55-708113b0e905" /\>
> 
> \> Note: The UI/layout can be changed based on suggestions in this PR. The screenshot is just an initial implementation
> 
> \### Implementation overview
> \- src/views/Index.vue: reuse DocumentationLayout with a filtered Navigator (top-level only); hero text now uses new i18n keys (documentation.hero.title/copy); cards use TopicTypeIcon; responsive 3/2/1 grid; hero width responsive (50% on desktop, full on smaller screens); simplified themed styling.
> \- Routing unchanged; home remains “/”.
> \- i18n: added documentation.hero.title and documentation.hero.copy to locale files (en-US, ja-JP, zh-CN, ko-KR).
> \- Tests: new tests/unit/views/Index.spec.js covers hero i18n, navigator top-level-only data, and hiding empty sections.
> \- Styles cleaned to rely on theme tokens for color/shadows and responsive spacing.
> 
> Inspiration explicitly taken from https://developer.apple.com/documentation ’s documentation landing layout.
> 
> \<img width="1697" height="1094" alt="Screenshot 2025-12-06 at 12 31 22 p m" src="https://github.com/user-attachments/assets/e177ea31-ba52-45eb-8570-8d3395bef618" /\>
> 
> 
> 
> \## Dependencies
> 
> None
> 
> \## Testing
> 
> Steps:
> 1. Build the documentation archive
> 2. Run the renderer
> 3. Visit the server index (http://localhost:8080/)
> 
> \## Checklist
> 
> Make sure you check off the following items. If they cannot be completed, provide a reason.
> 
> \- \[x\] Added tests
> \- \[x\] Ran \`npm test\`, and it succeeded
> \- \[\] Updated documentation if necessary

---

<div class="post-metadata">

**Author:** ![Joseph\_Heck](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/joseph_heck/32/22369_2.png) [@Joseph\_Heck](https://forums.swift.org/u/Joseph_Heck)\
**Post date:** [May 2, 2026, 9:47pm UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/2 "2026-05-02T21:47:19Z")

</div>

I think what you're aiming for here is a pitch or ad-hoc review to help mitigate an issue with how the single page app (DocC-Render) works today - and I'm here for it. Today we're actively designing around this gap in the current functionality, along with the gap that a combined documentation page is only synthesized and can't be provided as a "curated experience" (aka rendered from markdown or something)

I think what you're proposing here definitely works as a stop-gap to fix an immediate problem, but the larger issue needs to be addressed as well.

While the docc-archive-as-JSON-bundle-of-data thing worked acceptably, and enabled the potential of native rendering for docs as well as HTML presentation with the single-page app, it brought with it significant challenges in presenting the content (requiring the `/documentation` in everything) that from a practical perspective has been (and continues to be) a notable challenge.

---

<div class="post-metadata">

**Author:** ![victorpuga](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/victorpuga/32/46421_2.png) [@victorpuga](https://forums.swift.org/u/victorpuga)\
**Post date:** [May 3, 2026, 5:25am UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/3 "2026-05-03T05:25:00Z")

</div>

Thanks for the feedback, @Joseph_heck. I've been exploring a couple of alternatives that might address both the immediate UX problem and the larger architectural concerns.

## Alternative 2: "Back to Documentation" Link

Simple, works for both simple and combined archives.

**Screenshot:**

 ![alternative-2-back-link](https://global.discourse-cdn.com/swift/original/3X/c/6/c64a93c25602c0ffbe1bc43e6a51777bd9bdba6f.jpeg)

**Why it works:** Minimal implementation, leverages existing patterns, no new routes.

* * *

## Alternative 3: Home Route with Data-Driven Content

Add a home route that renders `DocumentationTopic.vue`, mapping `/` to `/data/homepage.json`.

**Screenshot:**

 ![alternative-3-homepage-json](https://global.discourse-cdn.com/swift/original/3X/8/2/82fc0bc6cafd40f8c5a5730b38a3e88c4c001647.jpeg)

**Why it matters:**

- Reuses existing infrastructure (no new code patterns)
- Allows curated content via `homepage.json`
- Directly addresses the "curated experience" gap you mentioned
- Same model works for simple and combined archives

* * *

## Trade-offs

**Alternative 2** is quicker; **Alternative 3** aligns better with the larger direction.

However, with Alternative 3, we need to decide on the actual filename for the data file. This decision affects both the render side and requires changes to **swift-docc** to emit the file with the right name and content.

---

<div class="post-metadata">

**Author:** ![Joseph\_Heck](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/joseph_heck/32/22369_2.png) [@Joseph\_Heck](https://forums.swift.org/u/Joseph_Heck)\
**Post date:** [May 3, 2026, 7:27pm UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/4 "2026-05-03T19:27:57Z")

</div>

Thanks @victorpuga - to be clear, I'm not the owner/maintainer of DocC, more a very frequent user/consumer of its features as a means to present documentation, tutorials, and guides. The alternatives and suggestions you presented after were more limited in scope than what I was advocating for thinking - smaller and more focused, and maybe what you want to pitch or suggest - but not really what I was suggesting.

I think if we stay within the Javascript/single-page-app mode, there's a broader question that we need to address of how to provide a curated/edited view of a top-level page that directs and presents readers from a root URL or the root URL + `/documentation`.

While this is the status quo today, I'm not personally convinced this is working to the project and our reader's benefits, and that maybe we need to spend some time focused on a display that doesn't require a Javascript intermediary. The moving parts are all in the code base to allow us to render a fully static HTML site from a DocC archive collection. I think there's a lot of benefit in having the intermediary DocC Archive that we can merge, or display individually - and now that we're more actively merging more of these, it's become clear that the navigation between individual archive sets combined into a collection - while functional - could use some more attention in terms of navigating between the collections, how that's visually presented, and how we provide or present a top-level visual of the collection that can be explicitly designed, not just synthesized.

In my view, the quick-nav left panel - which in a single archive is pretty effective - doesn't hold up as well when you have multiple collections in a merged archive that you're displaying. As an example, when you're viewing: [Package Manager Docs](https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/), it's not at all clear that the collection includes the sibling [PackagePlugin API docs](https://docs.swift.org/swiftpm/documentation/packageplugin) and [PackageDescription API docs](https://docs.swift.org/swiftpm/documentation/packagedescription) - although you can see both from that synthesized page at the top ([https://docs.swift.org/swiftpm/documentation/](https://docs.swift.org/swiftpm/documentation/))

The collections show a disclosure triangle in the combined left nav so you can expand/collapse each collection, but that's it. On top of that, the left nav setup is (to me) visually larger and more prominent in the design and layout than I think it should be - detracting from the core content that's being made available - the docs themselves. I'd personally prefer a far more compact visual representation - keeping the searching and navigation capability, and perhaps expanding to even a breadcrumb concept so that you have a better representation of where you are within a deeper or broader collection of docs.

I'm not at all suggesting that your proposal needs adjustment for a pitch, more airing the pain points I'm seeing and broader conversation that I think the project should explore.

---

<div class="post-metadata">

**Author:** ![victorpuga](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/victorpuga/32/46421_2.png) [@victorpuga](https://forums.swift.org/u/victorpuga)\
**Post date:** [May 3, 2026, 8:08pm UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/5 "2026-05-03T20:08:51Z")

</div>

Thanks for the further clarification, @Joseph_Heck. You're articulating a much broader architectural concern than what I was addressing and I think you're right to push on this.

The merged archive navigation problem you're describing is real. When you have multiple collections combined, the left sidebar doesn't effectively communicate the relationships between them or help readers understand the scope of what's available.

## Potential approach:

**Scoped Navigation**  
Only show the current archive's pages in the left nav, with a selector or breadcrumb to switch between collections. This keeps the visual hierarchy cleaner and makes the structure of each collection immediately apparent.

As part of this, we could include a link in the "Documentation" text at the top of the sidebar that takes readers to the homepage, where they'd be able to see the combined archive's root and understand the full scope of what's available.

* * *

I personally want to address the homepage issue, but not as a quick patch. I want to do it in a way that's part of the larger solution. I feel strongly about adding a home route that renders `DocumentationTopic.vue` , mapping `/` to `/data/homepage.json`, because it treats the homepage as a first-class citizen in the data model and creates a foundation that can evolve with the broader architectural improvements.

Whether that's through a curated landing page, improved navigation structure, or rethinking how collections present themselves at the root, it should all work together.

I'd love to hear @ronnqvist and @marcus_ortiz's thoughts on this. What does the broader vision look like for merged archive presentation, and how should the homepage/root experience fit into that?

---

<div class="post-metadata">

**Author:** ![ronnqvist](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ronnqvist/32/20110_2.png) [@ronnqvist](https://forums.swift.org/u/ronnqvist)\
**Post date:** [May 13, 2026, 10:33am UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/6 "2026-05-13T10:33:51Z")

</div>

> [@victorpuga](#):
>
> I personally want to address the homepage issue, but not as a quick patch. I want to do it in a way that's part of the larger solution. I feel strongly about adding a home route that renders `DocumentationTopic.vue` , mapping `/` to `/data/homepage.json`, because it treats the homepage as a first-class citizen in the data model and creates a foundation that can evolve with the broader architectural improvements.

My feelings is that adding another page is a stop-gap solution to an immediate problem and that it would ultimately be phased out when addressing the core issues.

I still feel that it's perfectly fine to do it as a stop gap solution and believe that the timescale for it to be phased out could possibly be measured in years.

* * *

If we go back to the original problem statement:

> visiting `https://docs.swift.org/swiftpm/` shows an error, when ideally it should provide a clear landing experience that orients the user and directs them to the documentation modules and tutorials available in that archive.

I feel that the root cause of that issue is the need for a leading "documentation" path component which—as far as I know—is required by Docc Render to know what type of documentation page is requested (if it's a tutorial or not) so that it can load the right resources and put together the page. If that path component wasn't required then the `https://docs.swift.org/swiftpm` could _be_ the page that's on `https://docs.swift.org/swiftpm/documentation` today and the documentation for its modules (for example "PackageDescription") could be `https://docs.swift.org/swiftpm/packagedescription`.

Additionally, if we look ahead—at what's intended but not yet implemented for combined documentation archives—when it becomes possible to pass a catalog to the merge command, then the documentation that's currently at `https://docs.swift.org/swiftpm/documentation/packagemanagerdocs` _could_ become the landing page for the combined archive (which without the "documentation" component would be `https://docs.swift.org/swiftpm`) with the "PackageDescription" and "PackagePlugin" documentation having their own sub paths (`https://docs.swift.org/swiftpm/packagedescription` and `https://docs.swift.org/swiftpm/packageplugin`).

I don't know how much work it is to change DocC Render to not require a leading "documentation" component but this has been an issue for 5 years now.

* * *

My personal _vision_ is that DocC would transition to fully static HTML files as the default output format, that deploying to a different location would be as simple as moving the files there, and that renaming a path component would be as simple as renaming a file/directory.

I made some progress on this last year and DocC can now (as of the 6.3 release) emit a static HTML representation of the page's content for environments that don't run JavaScript. As mentioned in [the original pitch](https://forums.swift.org/t/supplementing-doccs-output-with-minimal-content-in-the-per-page-html-files/83631#p-384070-improvements-to-the-reading-experience-for-people-browsing-without-requiring-javascript-10), one natural next step would be to add a small amount of CSS to improve the reading experience; with the goal of looking exactly the same as the DocC Render single-page-app version. I've been finding a little bit of time to explore this but I'm still not ready to even open an early work-in-progress (draft) PR or to pitch the idea with more details here in the forums.

---

<div class="post-metadata">

**Author:** ![victorpuga](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/victorpuga/32/46421_2.png) [@victorpuga](https://forums.swift.org/u/victorpuga)\
**Post date:** [May 14, 2026, 1:36am UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/7 "2026-05-14T01:36:27Z")

</div>

Thanks for sharing that vision, @ronnqvist. I totally get the appeal of moving toward static HTML output. It's elegant, portable, and solves a lot of the fundamental architectural issues you're describing.

I do have a few questions as I think through this though.

1. What would you suggest for the immediate fix? The `/swiftpm/` → 404 problem affects users today, and even if the long-term solution is HTML-based, we need something in the meantime.

2. I already have forks of swift-docc and swift-docc-render that handle the new homepage with `homepage.json`. The implementation is nearly done, but I'm wondering if it's worth maintaining and upstreaming if it's ultimately going to be removed when the static HTML approach ships. What's your take on that?

3. I'm also genuinely eager to help move the static HTML rendering feature forward. What are the next steps, and where could I contribute effectively? Is there work on the styling layer you mentioned, or would it be more helpful to focus on a specific part of the pipeline?

---

<div class="post-metadata">

**Author:** ![ronnqvist](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ronnqvist/32/20110_2.png) [@ronnqvist](https://forums.swift.org/u/ronnqvist)\
**Post date:** [May 15, 2026, 5:44pm UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/8 "2026-05-15T17:44:02Z")

</div>

1. I’m not sure where I stand on the immediate issue. If either solution is significantly more isolated, and therefore easier to remove in the future, then that might be worth considering. If they’re about the same then I don’t know.

2. I don’t expect maintaining it would be too much trouble. It’s more how you feel about the remaining work.

3. There is both styling work and some additional components (mainly page layout directives) that DocC would need to output static HTML for.

---

<div class="post-metadata">

**Author:** ![victorpuga](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/victorpuga/32/46421_2.png) [@victorpuga](https://forums.swift.org/u/victorpuga)\
**Post date:** [May 16, 2026, 3:02pm UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/9 "2026-05-16T15:02:37Z")

</div>

Your response actually clarifies things for me. I'm leaning toward just adding a "back to documentation" link to the 404 page. It's considerably less effort and only touches swift-docc-render, which means it'll be much easier to remove when the path component requirement is eventually lifted.

![alternative-2-back-link](https://global.discourse-cdn.com/swift/optimized/3X/c/6/c64a93c25602c0ffbe1bc43e6a51777bd9bdba6f_2_1380x876.jpeg)

That said, I'd still like to document the implementation plan for a customizable `/` page across both repositories, in case there's interest in moving forward with it or if it helps inform the broader architecture work.

> **swift-docc homepage implementation**
>
> # `@HomePage` Directive Feature Implementation Overview
> 
> ## Summary
> 
> Implementation of a new `@HomePage` directive that enables custom homepage content in Swift-DocC.  
> This feature allows developers to write a custom homepage article (at `/well-known/homepage`) that will be prioritized over the auto-synthesized homepage, while maintaining backward compatibility with synthesized homepages.
> 
> The feature includes improvements to both authored and synthesized homepages:
> 
> - Custom homepages are preserved during archive merging operations
> - Authored homepages are rendered separately and output only as JSON (no HTML)
> - Synthesized homepages use a `detailedGrid` style with separate Modules and Tutorials sections
> - The homepage JSON is always available at `data/well-known/homepage.json`
> 
> * * *
> 
> ## Implementation Details
> 
> ### Core Components
> 
> **ConvertOutputConsumer Protocol** (`Sources/SwiftDocC/Infrastructure/ConvertOutputConsumer.swift`)
> 
> - Added new protocol method: `consume(homepage:)`
> - Includes default no-op implementation for backward compatibility
> - Allows custom consumers to override homepage handling
> 
> **ConvertFileWritingConsumer** (`Sources/DocCCommandLine/Action/Actions/Convert/ConvertFileWritingConsumer.swift`)
> 
> - Implements `consume(homepage:)` to write homepage JSON to `data/well-known/homepage.json`
> - Creates `data/well-known/` directory structure as needed
> - Encodes RenderNode as JSON without triggering HTML rendering
> 
> **ConvertActionConverter** (`Sources/SwiftDocC/Infrastructure/ConvertActionConverter.swift`)
> 
> - Filters `/well-known/homepage` from regular page rendering pipeline
> - Renders authored homepages separately when `context.hasHomePage` is true
> - Falls back to synthesized default homepage if no authored one exists
> - Marks authored homepages with `isCustomHomepageContent = true` flag
> - Uses `DocumentationContentRenderer` to create rich `TopicRenderReference` objects with abstracts
> 
> **MergeAction** (`Sources/DocCCommandLine/Action/Actions/Merge/MergeAction.swift`)
> 
> - Detects and preserves existing custom homepages from input archives
> - When custom homepage found, copies all content fields:
> - `abstractVariants` and `primaryContentSectionsVariants` for rich content
> - `sections` and `topicSections` for organization
> - `topicSectionsStyle` for visual presentation
> - `references` for all linked content
> - `hierarchyVariants` and `variants` for multi-platform support
> 
> - Warns if multiple custom homepages found; uses the first one
> - Falls back to synthesized homepage if none found
> - Maintains consistent behavior with ConvertActionConverter
> 
> **RenderMetadata** (`Sources/SwiftDocC/Model/Rendering/RenderNode/RenderMetadata.swift`)
> 
> - Added `isCustomHomepageContent` property to flag authored homepages
> - Properly encoded/decoded in Codable conformance for archive preservation
> 
> ### Synthesized Homepage Generation
> 
> **Modules Section**
> 
> - Collects root pages from `context.linkResolver.localResolver.rootPages()`
> - Creates `TopicRenderReference` objects using renderer for proper abstracts
> - Organized under "Modules" section with `#Modules` anchor
> 
> **Tutorials Section**
> 
> - Collects tutorial references from `context.tutorialTableOfContentsReferences`
> - Rendered with full abstracts and details
> - Organized under "Tutorials" section with `#Tutorials` anchor
> 
> **Styling**
> 
> - Uses `.detailedGrid` style for large card display with abstracts
> - Only creates sections if content exists (no empty sections)
> - Set `generated: true` to indicate auto-created sections
> 
> ### Output Handling
> 
> **JSON-Only Output**
> 
> - Homepage always written to `data/well-known/homepage.json`
> - No HTML file generated (prevents `/well-known/homepage/index.html`)
> - Enables clean integration with external tools and services
> 
> **Processing Order**
> 
> 1. Regular pages rendered (homepage filtered out)
> 2. Authored homepage rendered separately if present
> 3. Else synthesized homepage created with modules and tutorials
> 4. Homepage consumed via `consume(homepage:)` for JSON output
> 
> * * *
> 
> ## Architecture Overview
> 
> ### Data Flow
> 
> ```plaintext
> Authored Homepage Article (/well-known/homepage)
> ↓
> Rendered separately (filtered from normal page rendering)
> ↓
> Marked with isCustomHomepageContent = true
> ↓
> consume(homepage:) → data/well-known/homepage.json (JSON only, no HTML)
> 
> OR
> 
> Synthesized Homepage (fallback if no authored homepage)
> ↓
> Collect root pages (documentation modules)
> ↓
> Collect tutorial references
> ↓
> Create separate "Modules" and "Tutorials" sections (detailedGrid style)
> ↓
> consume(homepage:) → data/well-known/homepage.json (JSON only)
> 
> ```
> 
> ### Merge Process with Custom Homepages
> 
> ```plaintext
> Input Archives
> ↓
> Check each archive for existing homepage.json
> ↓
> If custom homepage found: preserve all content fields
> ↓
> Warn if multiple custom homepages exist
> ↓
> If no custom homepage: synthesize new one
> ↓
> Output merged archive with homepage at data/well-known/homepage.json
> 
> ```
> 
> * * *
> 
> ## Key Features
> 
> ### Authored Homepages
> 
> - Write custom homepage content using `@HomePage` directive
> - Full control over layout, abstracts, sections, and styling
> - Preserved during archive merging operations
> 
> ### Synthesized Homepages (Fallback)
> 
> - Auto-generated if no custom homepage provided
> - Displays all documentation modules and tutorials
> - Uses `detailedGrid` style with abstracts
> - Organized into separate "Modules" and "Tutorials" sections
> 
> ### JSON Output Only
> 
> - Homepage always available at `data/well-known/homepage.json`
> - No HTML page generated (no `/well-known/homepage/index.html`)
> - Clean integration with external tools and services
> 
> ### Archive Merging Support
> 
> - Custom homepages are fully preserved during merges
> - All content variants and styling maintained
> - Clear warnings if multiple custom homepages detected
> 
> * * *
> 
> ## Integration Points
> 
> ### API Changes
> 
> - **New Protocol Method:** `ConvertOutputConsumer.consume(homepage:)`
> - **New Metadata Flag:** `RenderMetadata.isCustomHomepageContent`
> 
> ### File Output
> 
> - **Location:** `data/well-known/homepage.json`
> - **Format:** JSON-encoded `RenderNode`
> - **Timing:** Emitted after all page rendering completes
> 
> ### Configuration
> 
> - Uses existing `context.hasHomePage` detection
> - Compatible with current feature flag system
> 
> * * *
> 
> ## Testing Recommendations
> 
> 1. **Authored Homepage Tests**
> 
> 2. **Synthesized Homepage Tests**
> 
> 3. **Merge Tests**
> 
> 4. **Edge Cases**
> 
> * * *
> 
> ## Backward Compatibility
> 
> Fully backward compatible:
> 
> - Existing packages without `@HomePage` directive get synthesized homepages
> - Default `consume(homepage:)` implementation allows custom consumers
> - No breaking changes to public APIs
> - `isCustomHomepageContent` flag is optional in JSON
> 
> * * *
> 
> ## Future Considerations
> 
> - Theme/styling customization for synthesized homepages
> - Custom section ordering in synthesized homepages
> - Homepage preview/validation tools
> - Integration with [developer.apple.com](http://developer.apple.com) homepage generation

> **swift-docc-render homepage implementation**
>
> # Homepage Feature with Locale Support — Implementation Overview
> 
> ## Summary
> 
> This feature implements a homepage route (`/`) that loads dedicated homepage content (`/data/well-known/homepage.json`), with full support for locale-prefixed routes (`/ar/`, `/en-US/`, etc.). The homepage reuses the existing `DocumentationTopic` view and integrates seamlessly with the locale routing system.
> 
> ## Implementation Details
> 
> ### Routing & Navigation
> 
> - **Homepage route:** Added a new root route (`/`) that renders the `DocumentationTopic.vue` component
> - **Route naming:** Route is named `'documentation-topic-home'` (contains `'documentation-topic'` substring) so existing scroll behavior checks work without modification
> - **Locale support:** Homepage is accessible at all locale-prefixed paths (`/ar/`, `/en-US/`, `/zh-CN/`, `/ja-JP/`, `/ko-KR/`) while fetching the same homepage data
> - **Locale routing constraints:** The `:locale` route parameter is constrained to only match valid locale slugs to prevent paths like `/documentation` from being incorrectly matched as `/:locale?/documentation`
> - **Home navigation:** The "Documentation" text in the sidebar now links to the homepage (or technology page if available), allowing users to navigate home from anywhere in the docs
> 
> ### Data & Path Management
> 
> - **Data location:** Homepage data is served from `/data/well-known/homepage.json`
> - **Path mapping:** The `createDataPath()` utility maps root path (`/`) to `/data/well-known/homepage.json`
> - **Locale-aware fetching:** `fetchDataForRouteEnter()` detects home routes by name and always fetches from the homepage data location, regardless of locale prefix
> - **Locale prefix preservation:** When navigating home from a locale-prefixed page, the locale prefix is included in the destination URL (e.g., `/ar/documentation/foo` → `/ar/`)
> 
> ### Navigation & UI
> 
> - **Homepage hierarchy:** The homepage displays the full documentation index hierarchy, including all top-level modules when multiple exist at the same level
> - **Filtered sidebar:** Well-known paths (e.g., `/well-known/homepage`) are filtered from the sidebar navigation to keep the interface focused
> - **Technology link:** The technology link is hidden when visiting the root path (`/`)
> - **Root link behavior:** The sidebar's "Documentation" title is now always clickable:
> - Links to the technology page if one exists in the hierarchy
> - Links to `/` (or `/:locale/` for locale-prefixed routes) as fallback
> 
> ### Testing
> 
> - Comprehensive test coverage for locale-prefixed home route data fetching
> - Tests verify that all locale variants fetch homepage data correctly
> - Tests ensure non-home locale routes continue to fetch locale-specific data (e.g., `/ar/documentation/...` fetches `/data/ar/documentation/....json`)
> - Route pattern tests updated to reflect constrained locale matching
> - Component tests updated to verify "Documentation" title renders as a clickable link
> 
> * * *
> 
> ## Key Design Decisions
> 
> 1. **Reuse DocumentationTopic view:** Homepage uses the same view component as documentation pages, minimizing code duplication and leveraging existing scroll behavior.
> 
> 2. **Well-known location:** Homepage data lives at `/data/well-known/homepage.json`.
> 
> 3. **Locale-aware routing:** Homepage respects locale prefixes—visiting `/ar/` fetches the same homepage content but maintains the locale context for subsequent navigation.
> 
> 4. **Constrained locale pattern:** Locale parameter is restricted to valid slugs to prevent routing ambiguity and 404 errors.
> 
> 5. **Filtered sidebar:** Well-known paths are excluded from sidebar navigation to keep the interface clean and focused.

* * *

After laying out the actual implementation plan, I'm wondering if your take changes at all. Does the 404 link still feel like the right call, or does the feature seem worth pursuing?

---

<div class="post-metadata">

**Author:** ![victorpuga](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/victorpuga/32/46421_2.png) [@victorpuga](https://forums.swift.org/u/victorpuga)\
**Post date:** [May 23, 2026, 12:48am UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/10 "2026-05-23T00:48:49Z")

</div>

Hi, @marcus_ortiz. I'd love your input on this direction. After laying out the fuller implementation plan for Alternative 3, I've decided to step back:

> I'm leaning toward just adding a "back to documentation" link to the 404 page. It's considerably less effort and only touches swift-docc-render, which means it'll be much easier to remove when the path component requirement is eventually lifted.

The reasoning is that David's vision for static HTML output and removing the `/documentation` path component is the real architectural fix. Alternative 3, while architecturally sound, would ultimately be scaffolding we'd tear down.

But I'm curious whether you see trade-offs here I might be missing. From your work on the renderer, does the "back to documentation" link feel like a sufficient stop-gap, or does the data-driven approach feel necessary for something else, maybe for merged archive UX or navigation patterns you're thinking about?

I want to make sure we're not choosing the simpler path at the cost of something more important down the line.

---

<div class="post-metadata">

**Author:** ![marcus\_ortiz](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/marcus_ortiz/32/19253_2.png) [@marcus\_ortiz](https://forums.swift.org/u/marcus_ortiz)\
**Post date:** [May 28, 2026, 11:39pm UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/11 "2026-05-28T23:39:48Z")

</div>

I think the "Back to Documentation" addition to the 404 page could be a good enhancement, even if it's just an intermediate solution for now.

I would be a little hesitant to add a root `/` route for the application before a more complete solution is ready though, since the renderer output from DocC is meant to be something that could be easily dropped into an existing website that may or may not already have its own root webpage (and other pages).  
Currently all routes are explicitly prefixed with either `/documentation` or `/tutorials` to more easily avoid those conflicts, although I can definitely see the frustration and confusion from the root route being a 404 for common scenarios where a developer hosts their docs on something like GitHub Pages.

---

<div class="post-metadata">

**Author:** ![victorpuga](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/victorpuga/32/46421_2.png) [@victorpuga](https://forums.swift.org/u/victorpuga)\
**Post date:** [July 15, 2026, 3:24am UTC](https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433/12 "2026-07-15T03:24:00Z")

</div>

I've got a PR ready. My approach: redirect the 404 to the first top-level module in the index. Works for both single and combined archives, and respects the route-prefixing design.

Would appreciate your feedback on the implementation.

> <https://github.com/swiftlang/swift-docc-render/pull/1020>
>
> \## Summary
> 
> Adds a conditional "Back to Documentation" link to the 404 (Not Fo…und) page that intelligently directs users to the first available module in the documentation. The implementation fetches the index data on page load and extracts the first module; if found, a link to that module is displayed. If no module is found or the fetch fails, the link is not rendered. Translations are provided for en-US, ja-JP, zh-CN, ko-KR, de-DE, es-419, fr-FR, it-IT, and pt-BR locales.
> 
> Based on the forum thread: https://forums.swift.org/t/improving-the-user-experience-at-the-documentation-archive-index/86433
> 
> \<img width="1652" height="1020" alt="image" src="https://github.com/user-attachments/assets/7d1460d1-8819-4f08-a671-1f02b83584e9" /\>
> 
> 
> \## Dependencies
> 
> None.
> 
> \## Testing
> 
> 1. Navigate to a non-existent URL (e.g., \`http://localhost:8080/nonexistent-page\`).
> 2. Verify that the 404 page displays with a "Back to Documentation" link below the error message.
> 3. Click the link and verify it navigates to the first available module.
> 
> \## Checklist
> 
> \- \[x\] Added tests
> \- \[x\] Ran \`npm test\`, and it succeeded
> \- \[\] Updated documentation if necessary (translations added; no other docs needed)
