Skip to content

Commit 2e2493d

Browse files
vLuckyyyCitralFlo
andauthored
Webiste v4. (#124)
* Add documantation markdown cms Signed-off-by: Martin Sulikowski <[email protected]> * Fix Signed-off-by: Martin Sulikowski <[email protected]> * Fix eslint Signed-off-by: Martin Sulikowski <[email protected]> * Resolve hydration error by moving Analytics and SpeedInsights components Signed-off-by: Martin Sulikowski <[email protected]> * add GitHub-style emoji and Table support to Markdown Signed-off-by: Martin Sulikowski <[email protected]> * Improve sidebar UI, prev/next navigation, and container layout * Improve navbar/docs-sidebar, fix copy button. improve alerts. Signed-off-by: Martin Sulikowski <[email protected]> * Improved CodeTabs (modern look, minimalism, better colors) and sidebar with SVG folder icon, sticky search, and sticky sidebar * Remove last updated Signed-off-by: Martin Sulikowski <[email protected]> * Improve code-tabs layout Signed-off-by: Martin Sulikowski <[email protected]> * Add backtick and codeblock dedicated components Signed-off-by: Martin Sulikowski <[email protected]> * Improve eternalcombat docs Signed-off-by: Martin Sulikowski <[email protected]> * Fix copy button for codeblocks Signed-off-by: Martin Sulikowski <[email protected]> * refactor(docs): improve sidebar styling to match Tailwind's design - Reduce folder icon size and make it more subtle - Update category headings typography - Adjust spacing and alignment * Fix <hr> element for light mode Signed-off-by: Martin Sulikowski <[email protected]> * Improve docs container. Improve animated heading. Signed-off-by: Martin Sulikowski <[email protected]> * Improve and make smoother animation's for faq Signed-off-by: Martin Sulikowski <[email protected]> * fix Signed-off-by: Martin Sulikowski <[email protected]> * Add cookies menu, add privacy policy, improve buttons Signed-off-by: Martin Sulikowski <[email protected]> * Add 404 page Signed-off-by: Martin Sulikowski <[email protected]> * Fix Signed-off-by: Martin Sulikowski <[email protected]> * UI/UX improvements, og image. seo improvements. Signed-off-by: Martin Sulikowski <[email protected]> * Fix alt. Signed-off-by: Martin Sulikowski <[email protected]> * Fix fix title generation Signed-off-by: Martin Sulikowski <[email protected]> * Fix Signed-off-by: Martin Sulikowski <[email protected]> * Improve UI/UX Signed-off-by: Martin Sulikowski <[email protected]> * improve navbar spacing Signed-off-by: Martin Sulikowski <[email protected]> * Add notification generator Signed-off-by: Martin Sulikowski <[email protected]> * Remove comments Signed-off-by: Martin Sulikowski <[email protected]> * Add playable sounds Signed-off-by: Martin Sulikowski <[email protected]> * Fix Build Signed-off-by: Martin Sulikowski <[email protected]> * improve app structure. * Add missing dropdown. * Add minimessages formatting, improve ui of chat. add alert box to generated yaml. Signed-off-by: Martin Sulikowski <[email protected]> * Fix Signed-off-by: Martin Sulikowski <[email protected]> * Animation's Signed-off-by: Martin Sulikowski <[email protected]> * Remove ghost button Signed-off-by: Martin Sulikowski <[email protected]> * Debloat, add table view, add announcement Signed-off-by: Martin Sulikowski <[email protected]> * Use sound table instead of sound dropdown Signed-off-by: Martin Sulikowski <[email protected]> * QoL text editor changes. Signed-off-by: Martin Sulikowski <[email protected]> * Improve table, QoL changes in sound's. Signed-off-by: Martin Sulikowski <[email protected]> * Prevent re-render of sidebar docs Signed-off-by: Martin Sulikowski <[email protected]> * Improve color picker Signed-off-by: Martin Sulikowski <[email protected]> * Fix table's Signed-off-by: Martin Sulikowski <[email protected]> * improve dynamic tables Signed-off-by: Martin Sulikowski <[email protected]> * Refactor old buttons to one component Signed-off-by: Martin Sulikowski <[email protected]> * Remove link icon from copy link button component * Add notification guide Signed-off-by: Martin Sulikowski <[email protected]> * Fix ToolsDropdown component on mobile * Add responsive sidebar for docs Signed-off-by: Martin Sulikowski <[email protected]> * fix lint Signed-off-by: Martin Sulikowski <[email protected]> * Fix lint Signed-off-by: vLuckyyy <[email protected]> * Fix build Signed-off-by: vLuckyyy <[email protected]> * Fix color picker Signed-off-by: vLuckyyy <[email protected]> * Fix sidebar rendering Signed-off-by: vLuckyyy <[email protected]> * Fix sidebar Signed-off-by: vLuckyyy <[email protected]> * Improve border-radius. Signed-off-by: vLuckyyy <[email protected]> * Follow ai Signed-off-by: vLuckyyy <[email protected]> * Fix Signed-off-by: vLuckyyy <[email protected]> * Lot of changes. * Follow ai review. fix linter errors. * Fix button * Fix. --------- Signed-off-by: Martin Sulikowski <[email protected]> Signed-off-by: vLuckyyy <[email protected]> Co-authored-by: Michał Wojtas <[email protected]>
1 parent adf1d53 commit 2e2493d

File tree

204 files changed

+12617
-6129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+12617
-6129
lines changed

.editorconfig

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
13+
# TypeScript and JavaScript files
14+
[*.{ts,tsx,js,jsx}]
15+
indent_style = space
16+
indent_size = 2
17+
18+
# JSON files
19+
[*.json]
20+
indent_style = space
21+
indent_size = 2
22+
23+
# YAML files
24+
[*.{yml,yaml}]
25+
indent_style = space
26+
indent_size = 2
27+
28+
# Markdown files
29+
[*.md]
30+
trim_trailing_whitespace = false
31+
32+
# CSS, SCSS files
33+
[*.{css,scss}]
34+
indent_style = space
35+
indent_size = 2

.eslintignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Build output
2+
.next/
3+
out/
4+
build/
5+
dist/
6+
7+
# Dependencies
8+
node_modules/
9+
10+
# Cache
11+
.cache/
12+
.eslintcache
13+
14+
# Public assets
15+
public/
16+
17+
# Generated files
18+
*.generated.*
19+
*.min.js
20+
21+
# Misc
22+
.DS_Store

.eslintrc.json

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,47 @@
11
{
2-
"extends": ["next", "prettier"],
2+
"extends": [
3+
"next/core-web-vitals",
4+
"prettier",
5+
"plugin:import/recommended",
6+
"plugin:import/typescript",
7+
"plugin:@typescript-eslint/recommended",
8+
"plugin:react/recommended",
9+
"plugin:react-hooks/recommended",
10+
"plugin:jsx-a11y/recommended"
11+
],
12+
"plugins": ["import", "@typescript-eslint", "react", "react-hooks", "jsx-a11y"],
313
"rules": {
414
"react/no-unescaped-entities": "off",
5-
"@next/next/no-page-custom-font": "off"
15+
"@next/next/no-page-custom-font": "off",
16+
"react/react-in-jsx-scope": "off",
17+
"react/prop-types": "off",
18+
"import/order": [
19+
"error",
20+
{
21+
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
22+
"newlines-between": "always",
23+
"alphabetize": { "order": "asc", "caseInsensitive": true }
24+
}
25+
],
26+
"no-console": ["warn", { "allow": ["warn", "error"] }],
27+
"no-debugger": "warn",
28+
"no-duplicate-imports": "error",
29+
"no-unused-vars": "off",
30+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
31+
"@typescript-eslint/explicit-function-return-type": "off",
32+
"@typescript-eslint/explicit-module-boundary-types": "off",
33+
"@typescript-eslint/no-explicit-any": "warn",
34+
"jsx-a11y/anchor-is-valid": "warn"
35+
},
36+
"settings": {
37+
"react": {
38+
"version": "detect"
39+
},
40+
"import/resolver": {
41+
"typescript": {},
42+
"node": {
43+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
44+
}
45+
}
646
}
747
}

.prettierignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build output
2+
.next/
3+
out/
4+
build/
5+
dist/
6+
7+
# Dependencies
8+
node_modules/
9+
bun.lockb
10+
11+
# Cache
12+
.cache/
13+
.eslintcache
14+
15+
# Logs
16+
*.log
17+
npm-debug.log*
18+
yarn-debug.log*
19+
yarn-error.log*
20+
21+
# Environment variables
22+
.env
23+
.env.local
24+
.env.development.local
25+
.env.test.local
26+
.env.production.local
27+
28+
# Misc
29+
.DS_Store
30+
*.pem
31+
coverage/
32+
.vercel

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44
"tabWidth": 2,
55
"singleQuote": false,
66
"jsxSingleQuote": false,
7+
"printWidth": 100,
8+
"bracketSpacing": true,
9+
"arrowParens": "always",
10+
"endOfLine": "lf",
11+
"bracketSameLine": false,
712
"plugins": ["prettier-plugin-tailwindcss"]
813
}

app/api/docs/search-index/route.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import fs from "fs";
2+
import path from "path";
3+
4+
import matter from "gray-matter";
5+
import { NextResponse } from "next/server";
6+
7+
function findMarkdownFiles(dir: string): string[] {
8+
const files: string[] = [];
9+
const entries = fs.readdirSync(dir, { withFileTypes: true });
10+
11+
for (const entry of entries) {
12+
const fullPath = path.join(dir, entry.name);
13+
if (entry.isDirectory()) {
14+
files.push(...findMarkdownFiles(fullPath));
15+
} else if (entry.isFile() && entry.name.endsWith(".md")) {
16+
files.push(fullPath);
17+
}
18+
}
19+
20+
return files;
21+
}
22+
23+
function generateSearchIndex() {
24+
const docsDir = path.join(process.cwd(), "content/docs");
25+
const files = findMarkdownFiles(docsDir);
26+
const searchIndex = [];
27+
28+
for (const file of files) {
29+
const content = fs.readFileSync(file, "utf8");
30+
const { data, content: markdownContent } = matter(content);
31+
const relativePath = path.relative(docsDir, file);
32+
const urlPath = `/docs/${relativePath.replace(/\.md$/, "")}`;
33+
34+
const excerpt = markdownContent
35+
.replace(/[#*`_~]/g, "")
36+
.replace(/\n/g, " ")
37+
.trim()
38+
.substring(0, 150);
39+
40+
searchIndex.push({
41+
title: data.title || path.basename(file, ".md"),
42+
path: urlPath,
43+
excerpt,
44+
});
45+
}
46+
47+
return searchIndex;
48+
}
49+
50+
export async function GET() {
51+
try {
52+
const searchIndex = generateSearchIndex();
53+
return NextResponse.json(searchIndex);
54+
} catch (error) {
55+
console.error("Error generating search index:", error);
56+
return NextResponse.json({ error: "Failed to generate search index" }, { status: 500 });
57+
}
58+
}

app/api/og/route.tsx

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import { ImageResponse } from "@vercel/og";
2+
import { NextRequest } from "next/server";
3+
4+
export const runtime = "edge";
5+
6+
export async function GET(req: NextRequest) {
7+
try {
8+
const { searchParams } = new URL(req.url);
9+
10+
const title = searchParams.get("title") || "EternalCode.pl";
11+
const subtitle = searchParams.get("subtitle") || "Open Source Solutions";
12+
const image = searchParams.get("image") || "https://eternalcode.pl/logo.svg";
13+
14+
return new ImageResponse(
15+
(
16+
<div
17+
style={{
18+
height: "100%",
19+
width: "100%",
20+
display: "flex",
21+
flexDirection: "column",
22+
alignItems: "center",
23+
justifyContent: "center",
24+
backgroundColor: "#ffffff",
25+
padding: "40px 80px",
26+
fontFamily: "Poppins, sans-serif",
27+
}}
28+
>
29+
<div
30+
style={{
31+
display: "flex",
32+
flexDirection: "row",
33+
alignItems: "center",
34+
justifyContent: "center",
35+
marginBottom: "40px",
36+
}}
37+
>
38+
<img
39+
src={image}
40+
alt="EternalCode Logo"
41+
width={120}
42+
height={120}
43+
style={{ marginRight: "20px" }}
44+
/>
45+
<div
46+
style={{
47+
display: "flex",
48+
flexDirection: "column",
49+
alignItems: "flex-start",
50+
justifyContent: "center",
51+
}}
52+
>
53+
<h1
54+
style={{
55+
fontSize: "60px",
56+
fontWeight: "bold",
57+
color: "#0d1117",
58+
margin: "0",
59+
lineHeight: "1.2",
60+
}}
61+
>
62+
{title}
63+
</h1>
64+
<p
65+
style={{
66+
fontSize: "30px",
67+
color: "#3b82f6",
68+
margin: "0",
69+
marginTop: "10px",
70+
}}
71+
>
72+
{subtitle}
73+
</p>
74+
</div>
75+
</div>
76+
<div
77+
style={{
78+
display: "flex",
79+
alignItems: "center",
80+
justifyContent: "center",
81+
marginTop: "20px",
82+
}}
83+
>
84+
<p
85+
style={{
86+
fontSize: "24px",
87+
color: "#6b7280",
88+
margin: "0",
89+
}}
90+
>
91+
eternalcode.pl
92+
</p>
93+
</div>
94+
</div>
95+
),
96+
{
97+
width: 1200,
98+
height: 630,
99+
}
100+
);
101+
} catch (e) {
102+
console.error(e);
103+
return new Response("Failed to generate OG image", { status: 500 });
104+
}
105+
}

app/api/project/route.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@ import { NextResponse } from "next/server";
22

33
export const revalidate = 3600;
44

5-
export async function GET(request: Request) {
5+
export async function GET(_request: Request) {
66
try {
7-
const res = await fetch(
8-
`https://cms.eternalcode.pl/api/projects?populate=*`,
9-
{
10-
headers: {
11-
Authorization: `Bearer ${process.env.ETERNALCODE_STRAPI_KEY}`,
12-
},
13-
next: { revalidate },
14-
}
15-
);
7+
const res = await fetch(`https://cms.eternalcode.pl/api/projects?populate=*`, {
8+
headers: {
9+
Authorization: `Bearer ${process.env.ETERNALCODE_STRAPI_KEY}`,
10+
},
11+
next: { revalidate },
12+
});
1613

1714
if (!res.ok) {
1815
const errorBody = await res.json();
@@ -28,9 +25,6 @@ export async function GET(request: Request) {
2825
});
2926
} catch (error) {
3027
console.error("Error fetching projects:", error);
31-
return NextResponse.json(
32-
{ error: "Failed to fetch projects" },
33-
{ status: 500 }
34-
);
28+
return NextResponse.json({ error: "Failed to fetch projects" }, { status: 500 });
3529
}
3630
}

app/api/team/route.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import { NextResponse } from "next/server";
22

3-
export const revalidate = 3600; // 1 hour
3+
export const revalidate = 3600;
44

5-
export async function GET(request: Request) {
5+
export async function GET(_request: Request) {
66
try {
7-
const res = await fetch(
8-
`https://cms.eternalcode.pl/api/team-members?populate=*`,
9-
{
10-
headers: {
11-
Authorization: `Bearer ${process.env.ETERNALCODE_STRAPI_KEY}`,
12-
},
13-
next: { revalidate },
14-
}
15-
);
7+
const res = await fetch(`https://cms.eternalcode.pl/api/team-members?populate=*`, {
8+
headers: {
9+
Authorization: `Bearer ${process.env.ETERNALCODE_STRAPI_KEY}`,
10+
},
11+
next: { revalidate },
12+
});
1613

1714
if (!res.ok) {
1815
const errorBody = await res.json();
@@ -28,9 +25,6 @@ export async function GET(request: Request) {
2825
});
2926
} catch (error) {
3027
console.error("Error fetching team data:", error);
31-
return NextResponse.json(
32-
{ error: "Failed to fetch team data" },
33-
{ status: 500 }
34-
);
28+
return NextResponse.json({ error: "Failed to fetch team data" }, { status: 500 });
3529
}
3630
}

0 commit comments

Comments
 (0)