Repository navigation
Conversation
Rename `cliDocs(version)` to `repoImages(repo, branch)` so other sources read from their own repository can resolve root-relative images. Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
Modules with a docs source configured in `shared/utils/module-docs.ts` get their own content instance (`module:<name>`), mounted at `/modules/<name>`. The module page renders the docs `index.md` instead of the README, with a docs navigation aside (drawers on mobile), and serves every docs page at `/modules/<name>/...`. Starts with @nuxt/icon (nuxt/icon#466). Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Production bundleComparing Initial page load
All client assets
Largest module increases
|
Drawers, the docs navigation, surround links and the docs image component are only rendered for modules with docs; `Lazy*` keeps them out of the initial bundle of every other module page. Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
- OG image: the docs trail as headline (`@nuxt/icon > Guide`), the page title as title - TechArticle and BreadcrumbList structured data, like `/docs` pages - List module docs pages in the sitemap Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
- Pass the docs page `useAsyncData` key as a `computed`: the build's async-data handler extraction took the getter key for a handler, so production pages failed to hydrate with NUXT_E3008 - Fetch the module, the docs navigation and the docs page in parallel, the navigation once per module - Skip the README in `/api/v1/modules/<name>` for modules with docs: it was shipped in every docs page payload (~140 KB) - Lazy-load the docs UI through `ModuleDocs*` components rather than lazy library components, which split shared chunks on every page - Keep a single h1 on docs pages: the page title, not the module name Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
Module docs pages negotiate markdown and link their `/raw/**.md` twin like `/docs` pages, and are listed in `/sitemap.md`, `/llms.txt` and `/llms-full.txt`. Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
`modules:v5` entries still carry the README of modules with docs. Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
Docs pages open on their breadcrumb, where the module icon marks the module, so moving between them does not land below a tall header. Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
For modules with docs, the Menu / On this page bar sits right under the site header, and docs page titles follow their breadcrumb closely. Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
Both wrap on narrow screens. Below `sm` the stats show their icon and number, with `downloads`/`stars` kept for screen readers and the tooltips. Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
The score was copied into the module by a watcher on the shared health map. Arriving from `/modules`, that map is already loaded, so the watcher never fired. Read it from the map with a computed instead. Amp-Thread-ID: https://ampcode.com/threads/T-01a1721c-4512-7150-9905-efce9f4b7f68 Co-authored-by: Sébastien Chopin <atinux@gmail.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hosts a module's docs under its module page, the same way the
nuxt/clicommand reference is mounted under/docs/<version>/api/commands. It starts with@nuxt/icon, whose docs come from nuxt/icon#554 (for nuxt/icon#466).shared/utils/module-docs.tsmaps a registry module name to a repository, branch andcontentDir. Only modules listed there get docs; every other module page is unchanged.module:<name>instance mounted at/modules/<name>. The push webhook and ref refresh pick it up fromCONTENT_INSTANCE_KEYS.modules/[slug].vuemoves tomodules/[slug]/[...path].vue./modules/<name>renders the docsindex.mdinstead of the README, so a docs source must have one./api/v1/modules/<name>skips the README for these modules.@nuxt/icon > Guide) and the page title. They also get TechArticle and BreadcrumbList structured data, like/docspages, and are listed in the sitemap.ModuleDocs*components loaded withLazy*, so module pages without docs don't load it./raw/**.mdtwin like/docspages. They are listed in/sitemap.md,/llms.txt(one section per module) and/llms-full.txt.cliDocs()is nowrepoImages(repo, branch), shared by the CLI and module docs.Before merging:
iconpoints at nuxt/icon'sdocsbranch so previews work. Switch it back tomainonce docs: add docs directory for nuxt.com/modules/icon icon#554 is merged.Not covered yet: search, the build snapshot and
/pullpreviews for module docs.pnpm lintand the unit tests pass. The app, server and shared type checks pass. The pages were checked in a dev server at desktop and mobile widths, using a local nuxt/icon checkout (NUXT_ICON_PATH).