Skip to content

Commit

Permalink
ci: Fix astro check
Browse files Browse the repository at this point in the history
  • Loading branch information
dhAlcojor committed Jul 19, 2024
1 parent 0fb25c2 commit c9181c5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
7 changes: 3 additions & 4 deletions src/components/Card.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ interface Props {
className?: string;
title: string;
body: string;
href: string;
tags: string[];
repoUrl: string;
demoUrl: string;
}
const { image, className, title, body, href, tags, repoUrl, demoUrl } = Astro.props;
const { image, className, title, body, tags, repoUrl, demoUrl } = Astro.props;
---

<li class=`list-none text-white rounded-md hover:bg-gradient ${className || ''}`>
Expand All @@ -30,13 +29,13 @@ const { image, className, title, body, href, tags, repoUrl, demoUrl } = Astro.pr
</ul>
<ul class="links flex justify-end gap-2 mt-2">
<li>
<a href={repoUrl}>
<a href={repoUrl} target="_blank">
<Icon icon="github" />
<span>código</span>
</a>
</li>
<li>
<a href={demoUrl}>
<a href={demoUrl} target="_blank">
<Icon icon="web" />
<span>demo</span>
</a>
Expand Down
7 changes: 3 additions & 4 deletions src/components/Icon.astro
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
import {IconName} from "../types";
import type {IconName} from "../types";
import {ICONS} from "../constants";
interface Props {
icon: IconName;
className?: string;
}
const { icon, className } = Astro.props;
const { icon } = Astro.props;
const { default: innerHTML } = await import(`../icons/${ICONS[icon]}.svg?raw`);
---

<Fragment class={className} set:html={innerHTML} />
<Fragment set:html={innerHTML} />
4 changes: 2 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Icon from "../components/Icon.astro";
import {IconName} from "../types";
import type {IconName} from "../types";
interface Props {
title: string;
}
Expand Down Expand Up @@ -50,7 +50,7 @@ const SOCIAL_LINKS: SocialLink[] = [
<div class="social-links mt-2 flex justify-center gap-2 text-white text-2xl">
{
SOCIAL_LINKS.map(({ name, href, icon }, index) => (
<a class={index % 2 == 0 ? 'text-primary' : 'text-accent'} href={href} target="_blank">
<a class={index % 2 == 0 ? 'text-primary' : 'text-accent'} href={href} target="_blank" title={name}>
<Icon icon={icon} />
</a>
))
Expand Down
9 changes: 5 additions & 4 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ const projects = [
{
image: "https://placehold.co/1200x400",
title: "[000] 101 Proyectos",
href: "/projects/001-101-projects",
description: "La página de los 101 proyectos de Daniel H. Alcojor (sí, esta misma que estás visitando ahora mismo).",
tags: ["astro", "learning in public"],
repoUrl: "https://github.com/dhAlcojor/101-projects",
demoUrl: "https://dhalcojor.github.io/101-projects/",
},
]
---
Expand All @@ -23,15 +24,15 @@ const projects = [
<strong>101 Proyectos</strong> es un repositorio de proyectos de código abierto para aprender y compartir con la comunidad.
</p>
<ul role="list" class="grid grid-cols-1 md:max-w-[67%] lg:grid-cols-3 lg:gap-4 mt-8 p-0 mx-auto">
{projects.map((project, index) => (
{projects.map((project) => (
<Card
className="md:col-start-2"
key={index}
image={project.image}
href={project.href}
title={project.title}
body={project.description}
tags={project.tags}
repoUrl={project.repoUrl}
demoUrl={project.demoUrl}
/>
))}
</ul>
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import type {ICONS} from "./constants.ts";

export type IconName = keyof typeof ICONS;

0 comments on commit c9181c5

Please sign in to comment.