feat: publish the documentation and the card wizard from one Astro site - #489
feat: publish the documentation and the card wizard from one Astro site#489marcalexiei wants to merge 21 commits into
Conversation
|
@marcalexiei is attempting to deploy a commit to the martin-mfg's projects Team on Vercel. A member of the Team first needs to authorize it. |
7e9adf6 to
54c23d8
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
e7c4022 to
b91a859
Compare
b91a859 to
05538de
Compare
martin-mfg
left a comment
There was a problem hiding this comment.
I haven't completely reviewed all changes yet. But I reviewed most of them and don't want to keep you waiting longer for initial feedback.
Btw, good idea to go with Astro+Starlight instead of MkDocs. 👍
| ## Responsive Card Theme | ||
|
|
||
| [](https://github.com/stats-organization/github-stats-extended#responsive-card-theme#gh-dark-mode-only) | ||
| [](https://github.com/stats-organization/github-stats-extended#responsive-card-theme#gh-light-mode-only) |
There was a problem hiding this comment.
The theming via #gh-dark-mode-only/#gh-light-mode-only doesn't work here.
There was a problem hiding this comment.
The section header now uses <picture>, and the GitHub-only technique says why it has no live preview.
The copyable snippet is unchanged.
There was a problem hiding this comment.
The <picture> element currently responds to the browser theme, not to the page theme. Could you fix this please?
edit: preview link
There was a problem hiding this comment.
Each preview is now a card-preview-light / card-preview-dark image pair,
with one rule in starlight-theme.css hiding the wrong one per :root[data-theme].
Applied here and to the six previews on the Overview page, which had the same problem.
I also dropped the live example under "Use GitHub's new media feature":
it follows prefers-color-scheme by definition, so it could never match the page theme.
It now has a note instead, like the #gh-dark-mode-only section.
Note the Overview previews still look the same in both themes:
they use light_github / dark_github, which the current deployment does not serve yet.
The swap itself works: the Responsive Card Theme preview uses default / dark and changes correctly.
There was a problem hiding this comment.
they use light_github / dark_github, which the current deployment does not serve yet.
I think we should use relative urls like src="/api?username=anuraghazra&theme=light_github" for docs images where applicable. Then we could verify the docs look as expected already on the master branch and don't need to wait for a release to check them. Or am I missing any important downsides?
(They wouldn't work locally anymore, but I think that's ok.)
There was a problem hiding this comment.
I think we should use relative urls like
src="/api?username=anuraghazra&theme=light_github"for docs images where applicable.
Every live card image now uses /api?..., including the generated theme gallery.
(They wouldn't work locally anymore, but I think that's ok.)
I disagree: it would mean that every docs change waits on a deploy or that you deploy the changes on Vercel preview from the PR.
apps/backend/express.js already exists unused so I wired it up:
pnpm dev:backendruns the API on:9000
(it loadsPAT_1fromapps/backend/.env; Postgres stays optional, so a token is all a contributor needs).pnpm dev:frontendproxies/apithere, so the relative URLs resolve while authoring..github/CONTRIBUTING.mddocuments both.
Notes
express.jsnow strips a trailing slash before the router, because Vercel resolves/api/pin/to the same function as/api/pinwhile the router matches paths exactly.
I dropped all trailing slashes from the docs URLs.starlight-links-validatortreated/api?...as internal links, so it now excludes/api.
2b20bc5 to
24b8c19
Compare
24b8c19 to
bc40152
Compare
f501a69 to
be05cde
Compare
b5c0ea8 to
05aa52f
Compare
05aa52f to
0cccbe7
Compare
| "redirects": [ | ||
| { | ||
| "source": "/", | ||
| "destination": "https://github.com/stats-organization/github-stats-extended" |
There was a problem hiding this comment.
vercel.json sent / to the GitHub repo, it now redirects to /frontend/docs/.
Since the destination is a path rather than a full URL, a preview lands on its own docs instead of production's.

releaseinstead ofmaster#461apps/frontendinto an Astro + Starlight site.Serves the docs at
/frontend/docsand the card wizard at/frontend:one dev server, one build, one deploy, and no Python in
vercel-preparation.shor in the local setup.splashlayout,so it inherits the header, footer and search.
Its own app bar, theme picker and Redux theme slice go away.
Starlight writes the
data-themedaisyUI already reads, so one control themes both halves.*.mdsources move toapps/frontend/src/content/docs/docs/with atitleinfrontmatter and Starlight's
:::noteasides, which lets Astro resolve their links andimages natively (no markdown-conversion code of our own).
starlight-links-validatorthen fails the build on a dead internal link.packages/core/src/themes/README.mdis generated into the site instead; README and CONTRIBUTING links follow the move.index.cssdeclares the cascade-layer order(its utilities must outrank Starlight's reset) and scopes the app's element rules under
.wizard, leaving the site identical on both halves.To try it out just run