Skip to content

Commit

Permalink
Merge branch 'master' into improve_caching_behavoir
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa committed Nov 21, 2022
2 parents 7ec9096 + f07cd13 commit 19969bc
Show file tree
Hide file tree
Showing 32 changed files with 520 additions and 126 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ body:
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Expected behaviour
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ body:
description:
A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
Expand Down
5 changes: 2 additions & 3 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as dotenv from "dotenv";
import { renderStatsCard } from "../src/cards/stats-card.js";
import { blacklist } from "../src/common/blacklist.js";
import {
Expand All @@ -11,8 +10,6 @@ import {
import { fetchStats } from "../src/fetchers/stats-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

export default async (req, res) => {
const {
username,
Expand All @@ -26,6 +23,7 @@ export default async (req, res) => {
include_all_commits,
line_height,
title_color,
ring_color,
icon_color,
text_color,
text_bold,
Expand Down Expand Up @@ -81,6 +79,7 @@ export default async (req, res) => {
include_all_commits: parseBoolean(include_all_commits),
line_height,
title_color,
ring_color,
icon_color,
text_color,
text_bold: parseBoolean(text_bold),
Expand Down
3 changes: 0 additions & 3 deletions api/top-langs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as dotenv from "dotenv";
import { renderTopLanguages } from "../src/cards/top-languages-card.js";
import { blacklist } from "../src/common/blacklist.js";
import {
Expand All @@ -11,8 +10,6 @@ import {
import { fetchTopLanguages } from "../src/fetchers/top-languages-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

export default async (req, res) => {
const {
username,
Expand Down
3 changes: 0 additions & 3 deletions api/wakatime.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as dotenv from "dotenv";
import { renderWakatimeCard } from "../src/cards/wakatime-card.js";
import {
clampValue,
Expand All @@ -10,8 +9,6 @@ import {
import { fetchWakatimeStats } from "../src/fetchers/wakatime-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

export default async (req, res) => {
const {
username,
Expand Down
6 changes: 3 additions & 3 deletions docs/readme_kr.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<img width="100px" src="https://res.cloudinary.com/anuraghazra/image/upload/v1594908242/logo_ccswme.svg" align="center" alt="GitHub Readme Stats" />
<h2 align="center">GitHub Readme Stats</h2>
<p align="center">동적으로 생성되는 Github 사용량 통계를 여러분의 README 에 추가해보세요!</p>
<p align="center">동적으로 생성되는 GitHub 사용량 통계를 여러분의 README 에 추가해보세요!</p>
</p>
<p align="center">
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
Expand Down Expand Up @@ -72,7 +72,7 @@

아래 코드를 복사해서 마크다운 파일에 붙여넣으면 끝이에요, 아주 간단해요!

`?username=` 속성의 값을 Github 계정의 사용자 명(닉네임)으로 바꿔주세요.
`?username=` 속성의 값을 GitHub 계정의 사용자 명(닉네임)으로 바꿔주세요.

```md
[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)
Expand Down Expand Up @@ -235,7 +235,7 @@ GitHub 저장소 여분 핀을 이용하면, 6개 이상의 저장소 핀을 여

# 언어 사용량 통계

언어 사용량 통계 카드는 Github 사용자가 가장 많이 사용한 언어가 표시됩니다.
언어 사용량 통계 카드는 GitHub 사용자가 가장 많이 사용한 언어가 표시됩니다.

_참고:
언어 사용량 통계는 GitHub 에서 가장 많이 사용된 언어의 표기일 뿐입니다.
Expand Down
4 changes: 2 additions & 2 deletions docs/readme_np.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Use [show_owner](#customization) variable to include the repo's owner username

टोप भाषाकार्डले github परयोग गर्नेहरुको प्रोग्रम्मिंग भाषाहरु देखाऊने गर्दछ |.

_NOTE: टोप भाषाहरुले आफ्नो सिपलाए संकेत गरेको होईन | योचै Github Metricबाट धेरै कुन भाषा परयोग भाकोलाए संकेत गरेको हो |
_NOTE: टोप भाषाहरुले आफ्नो सिपलाए संकेत गरेको होईन | योचै GitHub Metricबाट धेरै कुन भाषा परयोग भाकोलाए संकेत गरेको हो |
### प्रयोग

कोदलाए कपी- पेसेत readme मा गर्नु होला र लिंक परिवतन गर्नु होला |
Expand Down Expand Up @@ -389,7 +389,7 @@ NOTE: Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) we
येदि तपाइले यो प्रोजेक्ट चलाउनु बाकोक्ष बने र मलाई अझै प्रसंसा गर्ने हो बने तपाइले थुप्रै तरिका ले गर्नु सक्नु हुने छ :-

- यो प्रोजेक्टमा तपाइले प्रहयोग गर्दा मलाई क्रेडिट दिन सक्नु हुनेक्ष ।
- तपाइले Github ReadMe Stats स्तार्रेड गर्न सक्नु हुनेक्ष :rocket:
- तपाइले GitHub ReadMe Stats स्तार्रेड गर्न सक्नु हुनेक्ष :rocket:
- [![paypal.me/anuraghazra](https://ionicabizau.github.io/badges/paypal.svg)](https://www.paypal.me/anuraghazra) - तपाइले पेपाल बाट पनि सहयोग (डक्क्षिन) गर्न सक्नु हुनेक्ष | म ~~कोफी ~~ चिया . :tea: किन्न सक्क्षु ।

धन्याबाद! :heart:
Expand Down
6 changes: 4 additions & 2 deletions docs/readme_pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
<a href="/docs/readme_nl.md">Nederlands</a>
.
<a href="/docs/readme_np.md">नेपाली</a>
.
<a href="/docs/readme_tr.md">Türkçe</a>
</p>
</p>
<p align="center">Gostou do projeto? Por favor considere <a href="https://www.paypal.me/anuraghazra">fazer uma doação</a> para ajudar a melhorá-lo!
Expand Down Expand Up @@ -142,7 +144,7 @@ Personalize a aparência do seu `Stats Card` ou `Repo Card` da maneira que desej
- `cache_seconds` - Defina o cabeçalho do cache manualmente _(min: 1800, max: 86400)_
- `locale` - defina o idioma no cartão _(por exemplo. cn, de, es, etc.)_

> Nota sobre o cache: Cartões de repositório tem um cache padrão de 30 minutos (1800 segundos), se o número a contagem de forks e contagem de estrelas é menor que 1 mil o padrão é 2 horas (7200). Note também que o cache é limitado a um mínimo de 30 minutos e um máximo de 24 horas.
> Nota sobre o cache: Cartões de repositório tem um cache padrão de 30 minutos (1800 segundos), se o número a contagem de forks e contagem de estrelas é menor que 1 mil o padrão é 2 horas (7200 segundos). Note também que o cache é limitado a um mínimo de 30 minutos e um máximo de 24 horas.
#### Opções exclusivas do cartão de estatísticas:

Expand All @@ -167,7 +169,7 @@ Personalize a aparência do seu `Stats Card` ou `Repo Card` da maneira que desej

> :warning: **Importante:**
> Nomes de linguagens devem ser uma sequência escapada de URI, como específicado em [Codificação por cento](https://pt.wikipedia.org/wiki/Codificação_por_cento)
> (Isso é: `c++` deve se tornar `c%2B%2B`, `jupyter notebook` deve se tornar `jupyter%20notebook`, etc.)
> (Ou seja: `c++` deve se tornar `c%2B%2B`, `jupyter notebook` deve se tornar `jupyter%20notebook`, etc.)
---

Expand Down
14 changes: 7 additions & 7 deletions docs/readme_tr.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@

Alt kısımdaki kodu Kopyalayın ve yapıştırın. İşte bu kadar. Çok basit!

`?username=` değerini kendi Github kullanıcı adınız ile değiştirin.
`?username=` değerini kendi GitHub kullanıcı adınız ile değiştirin.

```md
[![Anurag'nın Github İstatistikleri](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)
[![Anurag'nın GitHub İstatistikleri](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)
```
_Not: Şu sıralamalar mevcut: S+ (en üst 1%), S (en üst 25%), A++ (en üst 45%), A+ (en üst 60%), and B+ (herkes).
Buradaki değerler [cumulative distribution function](https://en.wikipedia.org/wiki/Cumulative_distribution_function) ile hesaplanırken; commitler, katkılar, hatalar, yıldızlar, çekme istekleri, takipçiler ve sahip olunan depolar (repository) göz önünde bulundurulamaktadır.
Expand Down Expand Up @@ -199,7 +199,7 @@ bg_color içerisinde birden fazla rengi gradient olarak göstermek için virgül

# GitHub Ekstra Pinler

Github ekstra pinler profilinize 6'dan fazla repoyu / depoyu profilinizde pinleyebilirsiniz.
GitHub ekstra pinler profilinize 6'dan fazla repoyu / depoyu profilinizde pinleyebilirsiniz.

Hey! Artık 6 pin ile kısıtlı kalmayacaksınız!

Expand All @@ -225,7 +225,7 @@ Endpoint: `api/pin?username=mustafacagri&repo=github-readme-stats`

En çok kullanılan diller kartı kullanıcının en çok kullandığı dilleri gösterir.

_NOTE: En çok kullanılan dillerde yer alan bilgiler sizin yeteneğinizi ve benzeri şeyleri göstermek. Bu, kodlarınızda en çok kullandığınız dilleri gösteren bir Github metriğidir. Ayrıca, github-readme-stats'ın yeni özelliğidir.
_NOTE: En çok kullanılan dillerde yer alan bilgiler sizin yeteneğinizi ve benzeri şeyleri göstermek. Bu, kodlarınızda en çok kullandığınız dilleri gösteren bir GitHub metriğidir. Ayrıca, github-readme-stats'ın yeni özelliğidir.

### Kullanım

Expand Down Expand Up @@ -365,7 +365,7 @@ Genellikle resimleri yan yana düzenleyemezsiniz. Bunu yapmak için şu yaklaş

#### [@codeSTACKr'ın Yayınladığı Video Eğitimine Göz Atın](https://youtu.be/n6d4KHSKqGk?t=107)

Github API saatte sadece 5.000 isteğe izin verdiği için `https://github-readme-stats.vercel.app/api` adresindeki API'm bu limite muhtemelen takılmış olabilir. Eğer projeyi kendi Vercel sunucunuzda yayınlarsanız, böyle bir sorun yaşamayabilirsiniz. Deploy butonuna tıkla ve deploy başlasın!
GitHub API saatte sadece 5.000 isteğe izin verdiği için `https://github-readme-stats.vercel.app/api` adresindeki API'm bu limite muhtemelen takılmış olabilir. Eğer projeyi kendi Vercel sunucunuzda yayınlarsanız, böyle bir sorun yaşamayabilirsiniz. Deploy butonuna tıkla ve deploy başlasın!


NOT: [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) geliştirmesi sonrasında anlamadığımız bir şekilde 5.000 istek limitine takılmıyoruz :)
Expand All @@ -378,9 +378,9 @@ NOT: [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) geliştir
1. [vercel.com](https://vercel.com/) adresine gidin
1. `Log in`'e tıklayın
![](https://files.catbox.moe/tct1wg.png)
1. `Continue with GitHub`'e basarak Github ile giriş yapın
1. `Continue with GitHub`'e basarak GitHub ile giriş yapın
![](https://files.catbox.moe/btd78j.jpeg)
1. Github'a giriş yapın ve eğer çıkarsa tüm repolara izin verin.
1. GitHub'a giriş yapın ve eğer çıkarsa tüm repolara izin verin.
1. Bu repoyu fork'layın
1. [Vercel dashboard](https://vercel.com/dashboard)'unuza geri dönün.
1. `Import Project`'i seçin.
Expand Down
95 changes: 93 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Visit <https://indiafightscorona.giveindia.org> and make a small donation to hel
- [Top Languages Card](#top-languages-card)
- [Wakatime Week Stats](#wakatime-week-stats)
- [Themes](#themes)
- [Responsive Card Theme](#responsive-card-theme)
- [Customization](#customization)
- [Common Options](#common-options)
- [Stats Card Exclusive Options](#stats-card-exclusive-options)
Expand Down Expand Up @@ -150,12 +151,101 @@ Use `&theme=THEME_NAME` parameter like so :

#### All inbuilt themes

Github readme stats comes with several built-in themes (e.g. `dark`, `radical`, `merko`, `gruvbox`, `tokyonight`, `onedark`, `cobalt`, `synthwave`, `highcontrast`, `dracula`).
GitHub readme stats comes with several built-in themes (e.g. `dark`, `radical`, `merko`, `gruvbox`, `tokyonight`, `onedark`, `cobalt`, `synthwave`, `highcontrast`, `dracula`).

<img src="https://res.cloudinary.com/anuraghazra/image/upload/v1595174536/grs-themes_l4ynja.png" alt="GitHub Readme Stats Themes" width="600px"/>

You can look at a preview for [all available themes](./themes/README.md) or checkout the [theme config file](./themes/index.js) & **you can also contribute new themes** if you like :D

#### Responsive Card Theme

[![Anurag's GitHub stats-Dark](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)
[![Anurag's GitHub stats-Light](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)

Since GitHub will re-upload the cards and serve them from their [CDN](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls), we can not infer the browser/GitHub theme on the server side. There are, however, four methods you can use to create dynamics themes on the client side.

##### Use the transparent theme

We have included a `transparent` theme that has a transparent background. This theme is optimized to look good on GitHub's dark and light default themes. You can enable this theme using the `&theme=transparent` parameter like so:

```md
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=transparent)
```

<details>
<summary>:eyes: Show example</summary>

![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=transparent)

</details>

##### Add transparent alpha channel to a themes bg_color

You can use the `bg_color` parameter to make any of [the available themes](./themes/README.md) transparent. This is done by setting the `bg_color` to a colour with a transparent alpha channel (i.e. `bg_color=00000000`):

```md
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&bg_color=00000000)
```

<details>
<summary>:eyes: Show example</summary>

![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&bg_color=00000000)

</details>

##### Use GitHub's theme context tag

You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user GitHub theme automatically. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme:

```md
[![Anurag's GitHub stats-Dark](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)
[![Anurag's GitHub stats-Light](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)
```

<details>
<summary>:eyes: Show example</summary>

[![Anurag's GitHub stats-Dark](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)
[![Anurag's GitHub stats-Light](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)

</details>

##### Use GitHub's new media feature

You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-19-specify-theme-context-for-images-in-markdown-beta/) in HTML to specify whether to display images for light or dark themes. This is done using the HTML `<picture>` element in combination with the `prefers-color-scheme` media feature.

```html
<picture>
<source
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark"
media="(prefers-color-scheme: dark)"
/>
<source
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true"
media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
/>
<img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true" />
</picture>
```

<details>
<summary>:eyes: Show example</summary>

<picture>
<source
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark"
media="(prefers-color-scheme: dark)"
/>
<source
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true"
media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
/>
<img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true" />
</picture>

</details>

### Customization

You can customize the appearance of your `Stats Card` or `Repo Card` however you wish with URL parameters.
Expand Down Expand Up @@ -193,9 +283,10 @@ You can provide multiple comma-separated values in the bg_color option to render
- `count_private` - Count private commits _(boolean)_. Default: `false`.
- `line_height` - Sets the line height between text _(number)_. Default: `25`.
- `exclude_repo` - Exclude stars from specified repositories _(Comma-separated values)_. Default: `[] (blank array)`.
- `custom_title` - Sets a custom title for the card. Default: `<username> Github Stats`.
- `custom_title` - Sets a custom title for the card. Default: `<username> GitHub Stats`.
- `text_bold` - Use bold text _(boolean)_. Default: `true`.
- `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`.
- `ring_color` - Color of the rank circle _(hex color)_. Defaults to the theme ring color if it exists and otherwise the title color.

> **Note**
> When hide_rank=`true`, the minimum card width is 270 px + the title length and padding.
Expand Down
2 changes: 1 addition & 1 deletion scripts/close-stale-theme-prs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { RequestError } from "@octokit/request-error";
import { getGithubToken, getRepoInfo } from "./helpers.js";

const CLOSING_COMMENT = `
\rThis PR has been automatically closed due to inactivity. Please feel free to reopen it if you need to continue working on it.\
\rThis theme PR has been automatically closed due to inactivity. Please reopen it if you want to continue working on it.\
\rThank you for your contributions.
`;
const REVIEWER = "github-actions[bot]";
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getRepoInfo = (ctx) => {
/**
* Retrieve github token and throw error if it is not found.
*
* @returns {string} Github token.
* @returns {string} GitHub token.
*/
export const getGithubToken = () => {
const token = getInput("github_token") || process.env.GITHUB_TOKEN;
Expand Down
2 changes: 1 addition & 1 deletion scripts/preview-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const isPreviewComment = (inputs, comment) => {
* @param {number} issueNumber Issue number.
* @param {string} repo Repository name.
* @param {string} owner Owner of the repository.
* @returns {Object} The Github comment object.
* @returns {Object} The GitHub comment object.
*/
const findComment = async (octokit, issueNumber, owner, repo, commenter) => {
const parameters = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/push-theme-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
export BRANCH_NAME=updated-theme-readme
git --version
git config --global user.email "no-reply@githubreadmestats.com"
git config --global user.name "Github Readme Stats Bot"
git config --global user.name "GitHub Readme Stats Bot"
git branch -d $BRANCH_NAME || true
git checkout -b $BRANCH_NAME
git add --all
Expand Down
Loading

0 comments on commit 19969bc

Please sign in to comment.