feat(site): rebuild the package index site on the xpkgindex framework - #538
Merged
Conversation
The generator used to model xvm / programs / archs in its core, which meant every other ecosystem's pages carried them too. They are xlings concepts, so they live in `.xpkgindex/plugins/xim.py` now. - identity stays the short name: in xlings a descriptor's `namespace` (`config`, `xim`) is a classification label, and package references resolve as `[index:]name[@Version]` against the index repo — so joining it into the install command, as the mcpp side must, would produce commands the client rejects. Spelled out rather than left to the core default so a change there cannot silently rewrite 155 install commands - a descriptor without a `namespace` is not un-namespaced: it resolves in the index's default namespace, so those 146 packages group under `xim` instead of a "—" bucket that does not exist - facets from the fields this index actually populates: kind, category, status - `card` listing layout, where the row leads with the copyable install command - theme retoned (teal) so the two consumer sites are visually distinct - stale links fixed: d2learn/* moved to openxlings/*
Same documents, one section name shared with the other consumer index. The older `guides` config key still works, so this is a rename rather than a migration.
Install xlings, install a package from this index, verify it runs — then searching, listing and updating. Every command is taken from this repo's own README rather than written from memory: notably each install is a single package, which is the only form the repo documents. Also: the About page's project link went to the website; the website stays under the docs link and "project" now points at the repository, matching how mcpp-index reads.
The index defaults to Chinese, so an English or Traditional visitor got a Chinese title, a Chinese quick-start card and Chinese doc names. Site title and lede, the install label, the card, the doc nav titles, the kind/category/ status axes and the Package/Credits/Keywords headings now carry zh / en / zh-Hant. Descriptor field names — programs, aliases, authors — stay as written, so a package page and its .lua still read as the same document. Also splits the two links that shared one entry: 'website' is xlings.d2learn.org (globe icon), 'docs' now points at the documentation itself.
pkgindex-deploy checked out at the default depth of 1. xpkgindex detects a shallow clone and skips the growth curve, the history line and the contributor list rather than replaying a truncated log — so the deployed site has quietly been missing all three. fetch-depth: 0 restores them, and GITHUB_TOKEN raises the API rate limit and enables the author -> login mapping that merges one person's several git identities. The path filter gained .xpkgindex/** and docs/**: the plugin decides how every package reads, the docs are rendered as site pages, and the cache is what an offline build renders from. A change to any of them changes the site as much as a descriptor does, and none of them triggered a deploy. site-check is new. The other checks prove a descriptor installs; this proves it still renders — offline, so a pull request spends no rate limit, and --strict, so a replayed history that disagrees with the tree fails rather than warns. It also fails on any warning at all, and asserts that the pages a reader actually lands on exist in all three locales.
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.
Adopts the rebuilt xpkgindex framework (openxlings/xpkgindex#3) and adds the xim plugin that teaches it what a package means here. Companion PR: mcpplibs/mcpp-index#176.
Why a plugin, and why this one is the opposite of mcpp's
The old generator carried one ecosystem's assumptions in its core, and this index is where that showed:
[index:]name[@version]against the index repository, soxlings install xim.gccis not a thing. The plugin returnsIdentity.plain(...)explicitly. mcpp-index's plugin does the opposite, and the core now refuses to guess for either of them.programsandarchsare xlings concepts. They used to live in the core model, where they leaked onto mcpp's pages as a meaningless "XVM Managed: No". They are rendered here by this repo's plugin, and nowhere else.What lands
.xpkgindex/plugins/xim.py— identity, facets, the card row layout, and the Package / Credits / Keywords blocks..xpkgindex.json— the teal theme (light and dark), thecardlisting variant, the docs section, the homepage quick-start card, andzh/en/zh-Hant.docs/quick-start.md+docs/quick-start.en.md— the landing document and the homepage card. Every command was checked against this repo and the xlings docs..xpkgindex/cache/github.json— committed, so the deploy build touches no network and a rendered page never depends on GitHub being reachable at deploy time.The listing uses the card layout, where the whole question is "what do I type to get this": name and metadata on the header line, one copyable
xlings install …in a tinted strip, and the binary you end up with beside it.Three locales, including everything this repo writes
The default stays Chinese. Previously an English or Traditional visitor got a Chinese title, a Chinese quick-start card and Chinese doc names; now the title, lede, install label, card, doc navigation, the kind/category/status axes and the Package/Credits/Keywords headings all carry
zh/en/zh-Hant.Descriptor field names —
programs,aliases,authors— stay as written, so a package page and its.luastill read as the same document.linksalso splits what used to be one entry:websiteisxlings.d2learn.org(globe icon),docsnow points at the documentation itself.CI
fetch-depth: 0restores them, andGITHUB_TOKENraises the rate limit and merges contributor identities..xpkgindex/**anddocs/**are now included; a plugin or doc change used to deploy nothing.--stricton pull requests, failing on any warning, asserting the pages a reader lands on exist in all three locales, and uploading the built site as an artifact for review.Locally: 155 packages, 357 versions, 4 facet axes, 5 contributors, 0 warnings,
--offline --strictgreen.