Skip to content

Commit 265da00

Browse files
authored
Merge branch 'main' into adding-kanegawa-paper-theme
2 parents 46b4538 + 1ea6b25 commit 265da00

File tree

5 files changed

+68
-6
lines changed

5 files changed

+68
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/themes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Note: Theme names provided are case-insensitive and any use of underscores will
172172
| `everforest-dark` | ![image](https://github.com/user-attachments/assets/45a4e0a0-d330-4233-9d76-89003e59bb31) |
173173
| `everforest-light` | ![image](https://github.com/user-attachments/assets/592466c0-5a67-48cc-adf0-f8a21ca891b6) |
174174
| `oceanic-next` | ![image](https://github.com/user-attachments/assets/e0182770-a511-42b6-a40b-644317268a0f) |
175+
| `sakura-x` | ![image](https://github.com/user-attachments/assets/65360cfa-9d5e-42f2-b3c9-cc2815623413) |
175176

176177
### Can't find the theme you like?
177178

src/card.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,10 @@ function convertSvgToPng(string $svg, int $cardWidth, int $cardHeight): string
804804
*
805805
* @param string|array $output The stats (array) or error message (string) to display
806806
* @param array<string,string>|NULL $params Request parameters
807+
* @param int $errorCode The HTTP error code (used for JSON responses)
807808
* @return array The Content-Type header and the response body, and status code in case of an error
808809
*/
809-
function generateOutput(string|array $output, array $params = null): array
810+
function generateOutput(string|array $output, array $params = null, int $errorCode = 200): array
810811
{
811812
$params = $params ?? $_REQUEST;
812813

@@ -815,7 +816,7 @@ function generateOutput(string|array $output, array $params = null): array
815816
// output JSON data
816817
if ($requestedType === "json") {
817818
// generate array from output
818-
$data = gettype($output) === "string" ? ["error" => $output] : $output;
819+
$data = gettype($output) === "string" ? ["error" => $output, "code" => $errorCode] : $output;
819820
return [
820821
"contentType" => "application/json",
821822
"body" => json_encode($data),
@@ -864,13 +865,15 @@ function generateOutput(string|array $output, array $params = null): array
864865
* Set headers and output response
865866
*
866867
* @param string|array $output The Content-Type header and the response body
867-
* @param int $responseCode The HTTP response code to send
868+
* @param int $responseCode The HTTP response code to send (stored for JSON consumers but always returns 200 for images)
868869
* @return void The function exits after sending the response
869870
*/
870871
function renderOutput(string|array $output, int $responseCode = 200): void
871872
{
872-
$response = generateOutput($output);
873-
http_response_code($response["status"] ?? $responseCode);
873+
$response = generateOutput($output, null, $responseCode);
874+
// Always return HTTP 200 for SVG/PNG so GitHub's image proxy (Camo) displays error cards
875+
// instead of broken images. The original error code is included in JSON responses.
876+
http_response_code(200);
874877
header("Content-Type: {$response["contentType"]}");
875878
exit($response["body"]);
876879
}

src/themes.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,5 +2146,18 @@
21462146
"sideLabels" => "#7AA89F",
21472147
"dates" => "#C4B28A",
21482148
"excludeDaysLabel" => "#C8C093",
2149+
],
2150+
"sakura-x" => [
2151+
"background" => "#1a1b26",
2152+
"border" => "#9D4EDD",
2153+
"stroke" => "#FFFFFF",
2154+
"ring" => "#9D4EDD",
2155+
"fire" => "#e5c07b",
2156+
"currStreakNum" => "#FFFFFF",
2157+
"sideNums" => "#9d4edd",
2158+
"currStreakLabel" => "#e5c07b",
2159+
"sideLabels" => "#e5c07b",
2160+
"dates" => "#c0caf5",
2161+
"excludeDaysLabel" => "#c0caf5",
21492162
],
21502163
];

src/translations.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@
6464
"Excluding {days}" => "باستثناء {days}",
6565
"comma_separator" => "، ",
6666
],
67+
"as" => [
68+
"Total Contributions" => "মুঠ বৰঙণি",
69+
"Current Streak" => "বৰ্তমান ষ্ট্ৰীক",
70+
"Longest Streak" => "দীৰ্ঘতম ষ্ট্ৰীক",
71+
"Week Streak" => "সপ্তাহ ষ্ট্ৰীক",
72+
"Longest Week Streak" => "দীৰ্ঘতম সপ্তাহ ষ্ট্ৰীক",
73+
"Present" => "বৰ্তমান",
74+
"Excluding {days}" => "{days} বাদ দি",
75+
],
6776
"bg" => [
6877
"Total Contributions" => "Общ принос",
6978
"Current Streak" => "Дневна серия",
@@ -282,6 +291,15 @@
282291
"Present" => "현재",
283292
"Excluding {days}" => "{days}를 제외하고",
284293
],
294+
"mai" => [
295+
"Total Contributions" => "कुल योगदान",
296+
"Current Streak" => "वर्तमान योगदान क्रम",
297+
"Longest Streak" => "सभसँ लम्बा योगदान क्रम",
298+
"Week Streak" => "साप्ताहिक योगदान क्रम",
299+
"Longest Week Streak" => "सभसँ लम्बा साप्ताहिक योगदान क्रम",
300+
"Present" => "एखन धरि",
301+
"Excluding {days}" => "{days} कए छोड़िकय",
302+
],
285303
"mal" => [
286304
"Total Contributions" => "മൊത്തം സംഭാവനകൾ",
287305
"Current Streak" => "നിലവിലെ സ്ട്രീക്ക്",
@@ -411,6 +429,15 @@
411429
"Present" => "Presente",
412430
"Excluding {days}" => "Exceto {days}",
413431
],
432+
"ro" => [
433+
"Total Contributions" => "Contribuții totale",
434+
"Current Streak" => "Perioada curentă",
435+
"Longest Streak" => "Cea mai lungă perioadă",
436+
"Week Streak" => "Perioada săptămânală",
437+
"Longest Week Streak" => "Cea mai lungă perioadă săptămânală",
438+
"Present" => "Prezent",
439+
"Excluding {days}" => "Excludând {days}",
440+
],
414441
"ru" => [
415442
"Total Contributions" => "Общий вклад",
416443
"Current Streak" => "Текущая серия",
@@ -541,6 +568,24 @@
541568
"Excluding {days}" => "خارج {days}",
542569
"comma_separator" => "، ",
543570
],
571+
"tcy" => [
572+
"Total Contributions" => "ಒಟ್ಟು ಕೊಡುಗೆ",
573+
"Current Streak" => "ಪ್ರಸ್ತುತ ಸ್ಟ್ರೀಕ್",
574+
"Longest Streak" => "ಅತ್ಯಧಿಕ ಸ್ಟ್ರೀಕ್",
575+
"Week Streak" => "ವಾರದ ಸ್ಟ್ರೀಕ್",
576+
"Longest Week Streak" => "ಅತ್ಯಧಿಕ ವಾರದ ಸ್ಟ್ರೀಕ್",
577+
"Present" => "ಇತ್ತೆಗ್",
578+
"Excluding {days}" => "{days} ಬುಡ್ದು",
579+
],
580+
"te" => [
581+
"Total Contributions" => "మొత్తం సహకారం",
582+
"Current Streak" => "ప్రస్తుత సహకారం",
583+
"Longest Streak" => "అత్యధిక సహకారం",
584+
"Week Streak" => "వారపు సహకారం",
585+
"Longest Week Streak" => "అత్యధిక వారపు సహకారం",
586+
"Present" => "ప్రస్తుతం",
587+
"Excluding {days}" => "{days} మినహా",
588+
],
544589
"vi" => [
545590
"Total Contributions" => "Tổng số đóng góp",
546591
"Current Streak" => "Chuỗi đóng góp\nhiện tại",

0 commit comments

Comments
 (0)