forked from anuraghazra/github-readme-stats
-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Open
marcalexiei
wants to merge
14
commits into
stats-organization:master
Choose a base branch
from
marcalexiei:docs-frontend-astro
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| 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"; | ||
|
|
||
| /* | ||
| * 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() }, | ||
| // The published Advanced Customization page became the Cards and Customization groups. | ||
| // Astro prefixes `base` onto the source but not the destination, hence it spelled out here. | ||
| redirects: { | ||
| "/docs/advanced_documentation": `${base}/docs/customization/common-options/`, | ||
| // 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", | ||
| }, | ||
| ], | ||
| // The docs link to each other by site path, so a rename must fail the build. | ||
| plugins: [starlightLinksValidator()], | ||
| 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()], | ||
| 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the links in this file should point to https://github-stats-extended.vercel.app/frontend/docs/..., because the target *.md files are not supposed to be read on GitHub anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, all point at
https://github-stats-extended.vercel.app/frontend/docs/....Also fixed an unrelated stale link:
../backend/src/translations.js➡️../packages/core/src/translations.ts.