Skip to content

Commit f9f1b72

Browse files
committed
Added info gathering from GitHub
1 parent c5c4b3c commit f9f1b72

File tree

5 files changed

+69
-26
lines changed

5 files changed

+69
-26
lines changed

package-lock.json

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@as-integrations/next": "^3.0.0",
1414
"@radix-ui/react-avatar": "^1.0.4",
1515
"@radix-ui/react-dialog": "^1.0.5",
16+
"@radix-ui/react-icons": "^1.3.0",
1617
"@radix-ui/react-slot": "^1.0.2",
1718
"@vercel/analytics": "^1.1.2",
1819
"class-validator": "^0.14.1",

src/app/page.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ export default function Page() {
195195
title={project.title}
196196
description={project.description}
197197
tags={project.techStack}
198-
link={"link" in project ? project.link.href : undefined}
198+
link={"link" in project ? project.link : undefined}
199+
repo={project.repo}
199200
/>
200201
);
201202
})}

src/components/project-card.tsx

+18-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ import {
77
} from "./ui/card";
88
import { Badge } from "./ui/badge";
99

10+
import { GitHubLogoIcon } from '@radix-ui/react-icons'
11+
1012
interface Props {
1113
title: string;
1214
description: string;
1315
tags: readonly string[];
1416
link?: string;
17+
repo?: string;
1518
}
1619

17-
export function ProjectCard({ title, description, tags, link }: Props) {
20+
export function ProjectCard({ title, description, tags, link, repo }: Props) {
1821
return (
1922
<Card className="flex flex-col overflow-hidden border border-muted p-3">
2023
<CardHeader className="">
@@ -42,7 +45,7 @@ export function ProjectCard({ title, description, tags, link }: Props) {
4245
</div>
4346
</CardHeader>
4447
<CardContent className="mt-auto flex">
45-
<div className="mt-2 flex flex-wrap gap-1">
48+
<div className="mt-2 flex w-full flex-wrap gap-1">
4649
{tags.map((tag) => (
4750
<Badge
4851
className="px-1 py-0 text-[10px] print:px-1 print:py-0.5 print:text-[8px] print:leading-tight"
@@ -53,6 +56,19 @@ export function ProjectCard({ title, description, tags, link }: Props) {
5356
</Badge>
5457
))}
5558
</div>
59+
{
60+
repo && (
61+
<a
62+
href={repo}
63+
target="_blank"
64+
className="mt-2 ml-auto text-sm underline"
65+
>
66+
<div className="flex-none w-7 content-center">
67+
<GitHubLogoIcon className="w-6 h-6" />
68+
</div>
69+
</a>
70+
)
71+
}
5672
</CardContent>
5773
</Card>
5874
);

src/data/resume-data.tsx

+38-23
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ import {
1818
YearProgressLogo,
1919
} from "@/images/logos";
2020
import { GitHubIcon, LinkedInIcon, XIcon } from "@/components/icons";
21+
import { cache } from "react";
2122

22-
export const RESUME_DATA = {
23+
const _RESUME_DATA = {
2324
name: "Santiago de la cruz Martinez Lara",
2425
initials: "SL",
2526
location: "San Luis Potosí, México",
@@ -93,27 +94,41 @@ export const RESUME_DATA = {
9394
],
9495
description:
9596
"The oficial site for the Carrocerías Plus Business",
96-
// logo: ParabolLogo,
97-
link: {
98-
// label: "github.com",
99-
href: "https://carroceriasplus.com.mx/",
100-
},
101-
},
102-
{
103-
title: "The Hype Company (Demo Site)",
104-
techStack: [
105-
"Full Stack Developer",
106-
"TypeScript",
107-
"React",
108-
"Node.js",
109-
],
110-
description:
111-
"A demo store for a StreetWear Company: The Hype Company",
112-
// logo: ParabolLogo,
113-
link: {
114-
label: "github.com",
115-
href: "https://streetwear.santiago-lara.dev/",
116-
},
97+
link: "https://carroceriasplus.com.mx/",
98+
repo: undefined
11799
},
100+
// {
101+
// title: "The Hype Company (Demo Site)",
102+
// techStack: [
103+
// "Full Stack Developer",
104+
// "TypeScript",
105+
// "React",
106+
// "Node.js",
107+
// ],
108+
// description:
109+
// "A demo store for a StreetWear Company: The Hype Company",
110+
// link: "https://streetwear.santiago-lara.dev/",
111+
// repo: "https://streetwear.santiago-lara.dev/"
112+
// },
118113
],
119-
} as const;
114+
};
115+
116+
// Define Projects type
117+
export type ResumeData = typeof _RESUME_DATA.projects[0];
118+
119+
const user_repos = await fetch("https://api.github.com/users/PacifiK2460/repos", {
120+
cache: "no-cache",
121+
});
122+
const user_repos_json = await user_repos.json();
123+
const user_repos_with_cv_in_topics = user_repos_json.filter((repo: any) => repo.topics.includes("cv"));
124+
const repos: ResumeData[] = user_repos_with_cv_in_topics.map((repo: any) => ({
125+
title: repo.name,
126+
techStack: repo.topics,
127+
description: repo.description,
128+
link: repo.homepage,
129+
repo: repo.html_url,
130+
}));
131+
132+
_RESUME_DATA.projects.push(...repos);
133+
134+
export const RESUME_DATA = _RESUME_DATA;

0 commit comments

Comments
 (0)