Skip to content

Commit

Permalink
feat: change frontmatter, new data, update components, new links
Browse files Browse the repository at this point in the history
  • Loading branch information
luizchaves committed Sep 5, 2024
1 parent ff4c5cb commit 625ccab
Show file tree
Hide file tree
Showing 23 changed files with 277 additions and 131 deletions.
30 changes: 30 additions & 0 deletions src/components/CompactSubjectCard.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
import type { CollectionEntry } from 'astro:content';
export interface Props {
subject: CollectionEntry<'subjects'>;
}
const {
subject: {
data: { name, description, course, campus, preview, repository },
},
} = Astro.props;
---

<div class="subject-card rounded-md overflow-hidden shadow-lg bg-gray-100 p-4">
<a href={preview ?? repository} target="_blank">
<h1 class="text-xl font-bold mb-4">{name}</h1>
</a>
<p class="mb-4">
{description}
</p>
<ul class="flex">
<li class="text-sm text-gray-700 bg-white my-2 mx-1 py-1 px-2 rounded-full">
{course}
</li>
<li class="text-sm text-gray-700 bg-white my-2 mx-1 py-1 px-2 rounded-full">
{campus}
</li>
</ul>
</div>
50 changes: 43 additions & 7 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,46 @@ courses.sort((a, b) => a.data.name.localeCompare(b.data.name));
class="flex flex-col min-[425px]:flex-row min-[425px]:justify-between gap-10"
>
<section>
<h1 class="font-semibold">Projetos</h1>
<h1 class="font-semibold">Rede Social</h1>
<ul>
<li>
<a href="https://ifpb.github.io/projects/codes/page/1/">
Repositórios
<a href="https://www.linkedin.com/school/ifpb/"> IFPB </a>
</li>
<li>
<a
href="https://www.linkedin.com/company/programa-de-p%C3%B3s-gradua%C3%A7%C3%A3o-em-tecnologia-da-informa%C3%A7%C3%A3o/posts/?feedView=all"
>
PPGTI
</a>
</li>
<li>
<a href="https://ifpb.github.io/projects/people/page/1/"
>Alunos e Professores</a
<a
href="https://www.linkedin.com/company/assert-polo-embrapii/posts/?feedView=all"
>
Assert
</a>
</li>
<li>
<a
href="https://www.linkedin.com/in/polo-de-inova%C3%A7%C3%A3o-do-ifpb-11bb871b3/recent-activity/all/"
>
Polo de Inovação
</a>
</li>
</ul>
</section>
<section>
<h1 class="font-semibold">Links Úteis</h1>
<ul>
<li>
<a href="https://ifpb.github.io/projects/codes/page/1/">
Projetos do IFPB
</a>
</li>
<li>
<a href="https://ifpb.github.io/projects/people/page/1/">
Alunos e Professores
</a>
</li>
<li>
<a href="https://ifpb.github.io/exercises/">Exercícios</a>
Expand All @@ -36,7 +65,12 @@ courses.sort((a, b) => a.data.name.localeCompare(b.data.name));
<a href="https://github.com/ifpb/maratona-pop">Maratona POP</a>
</li>
<li>
<a href="https://joaopessoa.ifpb.edu.br/horario/">Horários</a>
<a href="https://joaopessoa.ifpb.edu.br/horario/">
Horários (HIFPB)
</a>
</li>
<li>
<a href="https://ifpb.github.io/talks-iftech/">IFTech</a>
</li>
</ul>
</section>
Expand All @@ -46,7 +80,9 @@ courses.sort((a, b) => a.data.name.localeCompare(b.data.name));
{
courses.map((course) => (
<li>
<a href={course.data.page}>{course.data.name}</a>
<a href={course.data.page}>
{course.data.level.compact} em {course.data.name}
</a>
</li>
))
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const projectId = project?.data?.repository
>
<section class="relative">
<figure class="overflow-hidden">
<a href={project.data.page} target="_blank">
<a href={project.data.page || project.data.repository} target="_blank">
<img
src={project.data.preview ?? '/imgs/project-placeholder.png'}
alt={project.data.title}
Expand Down
44 changes: 31 additions & 13 deletions src/components/SubjectCard.astro
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
---
import { getCollection } from 'astro:content';
import Icon from 'astro-icon';
import type { CollectionEntry } from 'astro:content';
export interface Props {
subject: CollectionEntry<'subjects'>;
}
const courses = await getCollection('courses');
const {
subject: {
data: { name, description, course, campus, preview, repository },
data: { name, description, course, campus, preview, professors, repository },
},
} = Astro.props;
const getCourseByName = (abbreviation: string) => {
return courses.find((course) => course?.data?.abbreviation === abbreviation);
};
---

<div class="subject-card rounded-md overflow-hidden shadow-lg bg-gray-100 p-4">
<a href={preview ?? repository} target="_blank">
<h1 class="text-xl font-bold mb-4">{name}</h1>
<div class="relative bg-gray-100 mb-4 p-4 border-l-8 border-green-900">
<a href={preview ?? repository}>
<h2 class="text-2xl font-bold mb-4 pr-2">{name}</h2>
</a>
<h2 class="text-lg font-semibold mb-1">Curso</h2>
<p class="mb-4">
{description}
{getCourseByName(course)?.data?.level?.full} em{' '}
{getCourseByName(course)?.data?.name}
<span class="uppercase">
({getCourseByName(course)?.data?.campus})
</span>
</p>
<ul class="flex">
<li class="text-sm text-gray-700 bg-white my-2 mx-1 py-1 px-2 rounded-full">
{course}
</li>
<li class="text-sm text-gray-700 bg-white my-2 mx-1 py-1 px-2 rounded-full">
{campus}
</li>
</ul>
<h2 class="text-lg font-semibold mb-1">Professores</h2>
<p class="mb-4">{professors.join(', ')}</p>
<h2 class="text-lg font-semibold mb-1">Descrição</h2>
<p class="mb-4">{description}</p>
<div class="absolute top-4 right-4">
<a
href={repository}
class="hover:text-gray-600 transition duration-500"
>
<Icon name="mdi:github" size={30} class="github-project-link" />
</a>
</div>
</div>
104 changes: 80 additions & 24 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import { z, defineCollection } from 'astro:content';

const campus = z.enum(['ifpb-jp', 'ifpb-cg', 'ifpb-gb', 'reitoria']);

const course = z.enum([
'cstsi',
'cstrc',
'csbee',
'csbes',
'cmpti',
'cstt',
'ctie',
'ctii',
]);

const subjectCollection = defineCollection({
schema: z.object({
id: z.string(),
name: z.string(),
abbreviation: z.string(),
description: z.string(),
course: z.string(),
campus: z.string(),
course,
campus,
repository: z.string().url(),
preview: z.string().url().optional(),
professors: z.array(z.string()),
Expand All @@ -19,52 +32,95 @@ const courseCollection = defineCollection({
id: z.string(),
name: z.string(),
abbreviation: z.string(),
level: z.string(),
campus: z.string(),
level: z.object({
compact: z.string(),
full: z.string(),
}),
campus,
page: z.string(),
}),
});

const studentCollection = defineCollection({
const occupationProfessor = z.object({
id: z.number(),
type: z.literal('professor'),
campus,
});

const occupationEmployee = z.object({
id: z.number(),
type: z.literal('employee'),
campus,
});

const occupationStudent = z.object({
id: z.number(),
type: z.literal('student'),
campus,
course,
isFinished: z.boolean().optional(),
});

const peopleCollection = defineCollection({
schema: z.object({
id: z.number(),
name: z.object({
compact: z.string(),
full: z.string(),
}),
avatar: z.string().url(),
courses: z.array(
z.object({
id: z.number(),
name: z.string(),
campus: z.string(),
isFinished: z.boolean().optional(),
})
occupations: z.array(
z.union([occupationProfessor, occupationStudent, occupationEmployee])
),
addresses: z.object({
github: z.string().url(),
linkedin: z.string().url(),
twitter: z.string().url().optional(),
stackoverflow: z.string().url().optional(),
lattes: z.string().email().optional(),
researchgate: z.string().email().optional(),
instagram: z.string().email().optional(),
lattes: z.string().url().optional(),
researchgate: z.string().url().optional(),
instagram: z.string().url().optional(),
email: z.string().email().optional(),
}),
}),
});

const subjectProject = z.object({
type: z.literal('subject'),
subject: z.string(),
semester: z.number(),
course,
campus,
});

const researchProject = z.object({
type: z.literal('research'),
campus,
});

const extensionProject = z.object({
type: z.literal('extension'),
campus,
});

const openSourceProject = z.object({
type: z.literal('open source'),
campus,
});

const projectCollection = defineCollection({
schema: z.object({
title: z.string(),
name: z.string(),
description: z.string(),
preview: z.string().url(),
page: z.string().url(),
repository: z.string().url(),
course: z.string(),
subject: z.string(),
semester: z.number(),
campus: z.string(),
repository: z.string().url().optional(),
preview: z.string().url().optional(),
page: z.string().url().optional(),
category: z.union([
subjectProject,
researchProject,
extensionProject,
openSourceProject,
]),
tags: z.array(z.string()),
owners: z.array(
z.object({
Expand All @@ -80,6 +136,6 @@ const projectCollection = defineCollection({
export const collections = {
subjects: subjectCollection,
courses: courseCollection,
students: studentCollection,
students: peopleCollection,
projects: projectCollection,
};
11 changes: 11 additions & 0 deletions src/content/courses/cmpti-jp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
id: cmpti-jp
name: Tecnologia da Informação
abbreviation: cmpti
level:
compact: Mestrado
full: Metrado Profissional
# Pós-Graduação em Mestrado Profissional em Tecnologia da Informação
campus: ifpb-jp
page: https://estudante.ifpb.edu.br/cursos/195/
---
4 changes: 3 additions & 1 deletion src/content/courses/cstrc-jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
id: cstrc-jp
name: Rede de Computadores
abbreviation: cstrc
level: Curso Superior Tecnólogo
level:
compact: Graduação
full: Curso Superior de Tecnologia
campus: ifpb-jp
page: https://estudante.ifpb.edu.br/cursos/37/
---
4 changes: 3 additions & 1 deletion src/content/courses/cstsi-jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
id: cstsi-jp
name: Sistemas para Internet
abbreviation: cstsi
level: Curso Superior Tecnólogo
level:
compact: Graduação
full: Curso Superior de Tecnologia
campus: ifpb-jp
page: https://estudante.ifpb.edu.br/cursos/39/
---
12 changes: 12 additions & 0 deletions src/content/courses/ctii-jp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: ctii-jp
name: Informática
abbreviation: ctii
level:
# CTIIEM: Curso Técnico de Informática Integrado ao Ensino Médio
# ETIM: Educação Técnica Integrada ao Médio
compact: Técnico Integrado ao Médio
full: Curso Técnico Integrado ao Ensino Médio
campus: ifpb-jp
page: https://estudante.ifpb.edu.br/cursos/183/
---
8 changes: 0 additions & 8 deletions src/content/courses/ctiiem-jp.md

This file was deleted.

8 changes: 0 additions & 8 deletions src/content/courses/mpti-jp.md

This file was deleted.

Loading

0 comments on commit 625ccab

Please sign in to comment.