Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Author

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.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pnpm run build:packages
pnpm run dev:frontend
```

The easiest way to run and test the project is to deploy it to Vercel as described in the [deployment guide](../docs/deploy.md).
The easiest way to run and test the project is to deploy it to Vercel as described in the [deployment guide](https://github-stats-extended.vercel.app/frontend/docs/deploy/).

## Tests

Expand Down Expand Up @@ -46,13 +46,13 @@ Never edit the generated files by hand — change the `.graphql` file and regene

## Themes Contribution

We have stopped the addition of new themes to decrease maintenance efforts. If you are considering contributing your theme just because you are using it personally, then instead of adding it to our theme collection, you can use card [customization options](../docs/advanced_documentation.md#customization).
We have stopped the addition of new themes to decrease maintenance efforts. If you are considering contributing your theme just because you are using it personally, then instead of adding it to our theme collection, you can use card [customization options](https://github-stats-extended.vercel.app/frontend/docs/customization/common-options/).

## Translations Contribution

GitHub-Stats-Extended supports multiple languages. If we are missing your language, you can contribute it! You can check the currently supported languages [here](../docs/advanced_documentation.md#available-locales).
GitHub-Stats-Extended supports multiple languages. If we are missing your language, you can contribute it! You can check the currently supported languages [here](https://github-stats-extended.vercel.app/frontend/docs/customization/locales/).

To contribute your language you need to edit the [backend/src/translations.js](../backend/src/translations.js) file and add a new property to each object where the key is the language code in [ISO 639-1 standard](https://www.andiamo.co.uk/resources/iso-language-codes/) and the value is the translated string.
To contribute your language you need to edit the [packages/core/src/translations.ts](../packages/core/src/translations.ts) file and add a new property to each object where the key is the language code in [ISO 639-1 standard](https://www.andiamo.co.uk/resources/iso-language-codes/) and the value is the translated string.

## Any contributions you make will be under the MIT Software License

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-theme-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: ./.github/actions/install-dependencies

- name: Generate readme
run: pnpm --filter ./packages/core/ run generate-theme-readme
run: pnpm run generate-theme-readme

- name: Create Pull Request if themes README has changed
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ apps/backend/vercel_token
apps/backend-copy

apps/frontend/.env
# Astro's generated types and content store
apps/frontend/.astro


.turbo
Expand Down
79 changes: 16 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,82 +5,35 @@
<a href="https://github-stats-extended.vercel.app/api?username=anuraghazra"><img src="https://github-stats-extended.vercel.app/api?username=anuraghazra"></a>
</div>

This project is the [extended, actively maintained successor](docs/fork.md) of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). It generates [various stats cards](#card-types), e.g. about your GitHub contributions, your top languages, etc. You can [customize](#advanced-customization) the cards via multiple parameters.

## Table of Contents

- [Quick Start](#quick-start)
- [Migration from github-readme-stats](#migration-from-github-readme-stats)
- [Card Types](#card-types)
- [Advanced Customization](#advanced-customization)
- [Run It Yourself](#run-it-yourself)
- [Acknowledgements](#acknowledgements)
- [Contributing](#contributing)
This project is the [extended, actively maintained successor](https://github-stats-extended.vercel.app/frontend/docs/fork/) of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). It generates stats cards about your GitHub contributions, your top languages and more, which you can [customize](https://github-stats-extended.vercel.app/frontend/docs/customization/common-options/) through a large set of parameters.

## Quick Start

- Copy and paste this into your markdown:
```markdown
[![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra)](https://github.com/stats-organization/github-stats-extended)
```
- Change the `?username=` value to your GitHub username.
- Done!

---

As more comfortable alternative, use the [GitHub-Stats-Extended Wizard](https://github-stats-extended.vercel.app/frontend) to create your custom stats card. Copy the generated markdown code and paste it into your [GitHub profile README](https://docs.github.com/en/account-and-profile/how-tos/profile-customization/managing-your-profile-readme#adding-a-profile-readme). Done!

## Migration from github-readme-stats
Copy and paste this into your markdown, then change the `?username=` value to your GitHub username:

To migrate from [github-readme-stats](https://github.com/anuraghazra/github-readme-stats) you only need to change the domain from `github-readme-stats.vercel.app` to `github-stats-extended.vercel.app`:

```diff
- https://github-readme-stats.vercel.app/api?username=octocat&theme=radical
+ https://github-stats-extended.vercel.app/api?username=octocat&theme=radical
```markdown
[![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra)](https://github.com/stats-organization/github-stats-extended)
```

GitHub-Stats-Extended aims to be fully compatible with github-readme-stats. For more details see [Compatibility Notes](docs/fork.md#compatibility-notes).

## Card Types

- Show your GitHub statistics:

![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api?username=anuraghazra)

- ...your top languages...:

![Top Langs](https://github-stats-extended.vercel.app/api/top-langs/?username=anuraghazra&langs_count=4)

- ...and development time:

[![Alan's WakaTime stats](https://github-stats-extended.vercel.app/api/wakatime?username=alan&langs_count=6)](https://wakatime.com/@alan)

- Pin more than 6 repos in your GitHub profile:

[![Readme Card](https://github-stats-extended.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats)

- Pin Gists in your GitHub profile:

[![Gist Card](https://github-stats-extended.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d)](https://gist.github.com/Yizack/bbfce31e0217a3689c8d961a356cb10d)

- Customize all the cards:

[![Anurag's GitHub stats](https://github-stats-extended.vercel.app/api/?username=anuraghazra&show_icons=true&theme=calm&rank_icon=github&include_all_commits=true&custom_title=Anurag's+Stats&disable_animations=true&number_format=long&show=prs_merged_percentage,prs_reviewed)](https://github-stats-extended.vercel.app/api/?username=anuraghazra&show_icons=true&theme=calm&rank_icon=github&include_all_commits=true&custom_title=Anurag's+Stats&disable_animations=true&number_format=long&show=prs_merged_percentage,prs_reviewed)

## Advanced Customization
As a more comfortable alternative, use the [card wizard](https://github-stats-extended.vercel.app/frontend) to configure your card visually, then copy the generated markdown into your [GitHub profile README](https://docs.github.com/en/account-and-profile/how-tos/profile-customization/managing-your-profile-readme#adding-a-profile-readme).

The [GitHub-Stats-Extended Wizard](https://github-stats-extended.vercel.app/frontend) offers some essential customization options. For more advanced customization check out the [advanced documentation](docs/advanced_documentation.md).
## Documentation

## Run It Yourself
The full documentation is served by the deployment it describes, so every sample it shows is rendered by the version that is actually running:

If you want to run GitHub-Stats-Extended on your own, there are two main deployment options: you can use [github-readme-stats-action](https://github.com/stats-organization/github-readme-stats-action) to generate cards in your own GitHub Actions workflow. Or you can self-host GitHub-Stats-Extended on Vercel.
**[github-stats-extended.vercel.app/frontend/docs](https://github-stats-extended.vercel.app/frontend/docs)**

See [Run It Yourself](docs/deploy.md) for detailed instructions.
- [Overview](https://github-stats-extended.vercel.app/frontend/docs/) — quick start and migration from github-readme-stats.
- [Cards](https://github-stats-extended.vercel.app/frontend/docs/#card-types) — a preview of every card, each linking through to its own options.
- [Customization](https://github-stats-extended.vercel.app/frontend/docs/customization/common-options/) — options every card shares, plus theming and locales.
- [Available Themes](https://github-stats-extended.vercel.app/frontend/docs/customization/themes/) — the built-in themes, rendered as live samples.
- [Run It Yourself](https://github-stats-extended.vercel.app/frontend/docs/deploy/) — GitHub Actions or a self-hosted Vercel deployment.
- [Fork Information](https://github-stats-extended.vercel.app/frontend/docs/fork/) — what this project adds on top of github-readme-stats.

## Acknowledgements

This project is based on [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). On top of that project's functionality GitHub-Stats-Extended adds several new features and improvements. See [Fork Information](docs/fork.md) for a list of changes. The frontend added to GitHub-Stats-Extended is based on [GitHub Trends](https://github.com/avgupta456/github-trends). Big thanks to [@anuraghazra](https://github.com/anuraghazra), [@avgupta456](https://github.com/avgupta456), [@rickstaa](https://github.com/rickstaa), [@qwerty541](https://github.com/qwerty541) and everyone else who worked on these projects! ❤️
This project is based on [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). The card wizard is based on [GitHub Trends](https://github.com/avgupta456/github-trends). Big thanks to [@anuraghazra](https://github.com/anuraghazra), [@avgupta456](https://github.com/avgupta456), [@rickstaa](https://github.com/rickstaa), [@qwerty541](https://github.com/qwerty541) and everyone else who worked on these projects! ❤️

## Contributing

Contributions are welcome!
Contributions are welcome! See [CONTRIBUTING.md](.github/CONTRIBUTING.md) to get started.
2 changes: 0 additions & 2 deletions apps/backend/.vercelignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ coverage
scripts
tests
.env
**/*.md
**/*.svg
.eslintrc.json
codecov.yml
115 changes: 115 additions & 0 deletions apps/frontend/astro.config.ts
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"],
},
},
},
});
Loading