forked from anuraghazra/github-readme-stats
-
-
Notifications
You must be signed in to change notification settings - Fork 494
feat: publish the documentation and the card wizard from one Astro site #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
martin-mfg
merged 22 commits into
stats-organization:master
from
marcalexiei:docs-frontend-astro
Aug 23, 2026
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
54c23d8
feat: publish the documentation and the card wizard from one Astro site
marcalexiei a91bef3
fix failing deployment due to missing md files
martin-mfg 2c8419c
docs(advanced_documentation): fix incorrect github action link
marcalexiei 05538de
docs: split the Advanced Customization page into focused pages
marcalexiei ae21ab5
chore(frontend): use caret ranges for astro and starlight
marcalexiei 743c84c
chore(frontend): replace deprecated rollupOptions with rolldownOptions
marcalexiei 1e20e81
chore(frontend): drop redundant DOM.Iterable lib
marcalexiei 1f6755c
docs(contributing): link the published docs instead of the markdown s…
marcalexiei 38401f6
fix(frontend): make the delete modal backdrop dim the whole page
marcalexiei cfc85a5
fix(frontend): restore the favicon, touch icon and web manifest
marcalexiei bda98b3
docs(customization): scope the caching note to the public deployment
marcalexiei 338eeed
docs(theming): stop showing GitHub-only theme switching as a live exa…
marcalexiei 7bdf536
docs(aligning-cards): render the examples side by side
marcalexiei bc40152
chore: move the theme readme generator to the repo-level scripts folder
marcalexiei 568e501
Merge remote-tracking branch 'origin/master' into docs-frontend-astro
martin-mfg be05cde
fix(frontend): remove `/advanced_documentation` redirect
marcalexiei fb099ab
rework documentation a bit
martin-mfg 328880e
docs: make the card previews follow the site theme
marcalexiei 83fbd47
replace theming notes
martin-mfg 0cccbe7
docs: reference cards by relative `/api` urls
marcalexiei 2a9b89b
fix(backend): send the site root to the docs instead of GitHub
marcalexiei 4fd3277
fix docs urls
martin-mfg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,5 @@ coverage | |
| scripts | ||
| tests | ||
| .env | ||
| **/*.md | ||
| **/*.svg | ||
| .eslintrc.json | ||
| codecov.yml | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| import path from "node:path"; | ||
|
|
||
| import react from "@astrojs/react"; | ||
| import starlight from "@astrojs/starlight"; | ||
| import tailwindcss from "@tailwindcss/vite"; | ||
| import { defineConfig, passthroughImageService } from "astro/config"; | ||
| import starlightLinksValidator from "starlight-links-validator"; | ||
|
|
||
| const base = "/frontend"; | ||
|
|
||
| // `pnpm dev:backend` serves the card endpoints; override to point at another instance. | ||
| const BACKEND_ORIGIN = process.env.BACKEND_ORIGIN ?? "http://localhost:9000"; | ||
|
|
||
| /* | ||
| * One app: Starlight serves the docs under `/frontend/docs`, and the card | ||
| * wizard is a page of the same site at `/frontend`. | ||
| */ | ||
| export default defineConfig({ | ||
| site: "https://github-stats-extended.vercel.app", | ||
| base, | ||
| outDir: "./build", | ||
| // One screenshot; not worth a native image dependency. | ||
| image: { service: passthroughImageService() }, | ||
| // Astro prefixes `base` onto the source but not the destination, hence it spelled out here. | ||
| redirects: { | ||
| // Sidebar group labels are not routes, so send them to the group's first page. | ||
| "/docs/cards": `${base}/docs/cards/stats/`, | ||
| "/docs/customization": `${base}/docs/customization/common-options/`, | ||
| }, | ||
| integrations: [ | ||
| react(), | ||
| starlight({ | ||
| title: "GitHub Stats Extended", | ||
| description: "Dynamically generate GitHub stats for your READMEs.", | ||
| logo: { src: "./src/assets/appLogo64.png", alt: "" }, | ||
| // Starlight defaults to a favicon.svg this project does not ship. | ||
| favicon: "/favicon.ico", | ||
| head: [ | ||
| { | ||
| tag: "link", | ||
| attrs: { rel: "apple-touch-icon", href: `${base}/logo192.png` }, | ||
| }, | ||
| { | ||
| tag: "link", | ||
| attrs: { rel: "manifest", href: `${base}/manifest.json` }, | ||
| }, | ||
| { tag: "meta", attrs: { name: "theme-color", content: "#000000" } }, | ||
| ], | ||
| social: [ | ||
| { | ||
| icon: "github", | ||
| label: "GitHub", | ||
| href: "https://github.com/stats-organization/github-stats-extended", | ||
| }, | ||
| ], | ||
| plugins: [ | ||
| starlightLinksValidator({ | ||
| // The docs link to each other by site path, so a rename must fail the build. | ||
| // `/api` and `/frontend` are not part of the docs, so they don't have matching pages. | ||
| exclude: ["/api/**", "/frontend"], | ||
| }), | ||
| ], | ||
| customCss: ["./src/styles/starlight-theme.css"], | ||
| components: { SiteTitle: "./src/components/SiteTitle.astro" }, | ||
| sidebar: [ | ||
| { label: "Overview", slug: "docs" }, | ||
| { | ||
| label: "Cards", | ||
| items: [ | ||
| { label: "Stats Card", slug: "docs/cards/stats" }, | ||
| { label: "Top Languages Card", slug: "docs/cards/top-languages" }, | ||
| { label: "Repo Pin Card", slug: "docs/cards/repo-pin" }, | ||
| { label: "Gist Pin Card", slug: "docs/cards/gist-pin" }, | ||
| { label: "WakaTime Card", slug: "docs/cards/wakatime" }, | ||
| ], | ||
| }, | ||
| { | ||
| label: "Customization", | ||
| items: [ | ||
| { | ||
| label: "Common Options", | ||
| slug: "docs/customization/common-options", | ||
| }, | ||
| { label: "Theming", slug: "docs/customization/theming" }, | ||
| // Generated by packages/core scripts/generate-theme-readme.js. | ||
| { label: "Available Themes", slug: "docs/customization/themes" }, | ||
| { label: "Locales", slug: "docs/customization/locales" }, | ||
| { | ||
| label: "Aligning Cards", | ||
| slug: "docs/customization/aligning-cards", | ||
| }, | ||
| ], | ||
| }, | ||
| { label: "Demo Gallery", slug: "docs/demos" }, | ||
| { label: "Run It Yourself", slug: "docs/deploy" }, | ||
| { label: "Fork Information", slug: "docs/fork" }, | ||
| ], | ||
| }), | ||
| ], | ||
| vite: { | ||
| plugins: [tailwindcss()], | ||
| /* | ||
| * On Vercel the same deployment serves `/api` and `/frontend`, so the docs can reference cards by root-relative path. | ||
| * Locally the two are separate servers, so forward `/api` to `pnpm dev:backend` to keep those paths working. | ||
| */ | ||
| server: { proxy: { "/api": BACKEND_ORIGIN } }, | ||
| resolve: { | ||
| conditions: ["@stats/source"], | ||
| alias: [ | ||
| { | ||
| find: "../fetchers/wakatime.js", | ||
| replacement: path.resolve( | ||
| import.meta.dirname, | ||
| "src/wakatime-override.ts", | ||
| ), | ||
| }, | ||
| ], | ||
| }, | ||
| // The backend code the wizard reuses imports `pg`, which never runs in the browser. | ||
| build: { | ||
| rolldownOptions: { | ||
| external: ["pg"], | ||
| }, | ||
| }, | ||
| }, | ||
| }); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.