- {Object.entries(groupedLinks).map(([subdirectory, links]) => (
-
-
{subdirectory}
-
- {links.map((link, index) => (
- -
- {
- link.type != "none" ?
- {link.label}
- : link.label
- }
-
-
- ))}
-
-
+
+
+ {Object.entries(groupedLinks).map(([subdirectory, links], index) => (
+
+ ))}
+
+ );
+}
+
+function ProjectSection({ subdirectory, links, basePath }) {
+ return (
+
+
+
{subdirectory}
+
+
+ {links.map((link, index) => (
+
))}
-
+
);
}
+function ProjectCard({ project, basePath }) {
+ return (
+
+
+
+
{project.label}
+
+ {project.type === "link" && (
+ -
+
+
+
+
+ )}
+ {project.type === "md" && (
+ -
+
+
+
+
+ )}
+ {project.type === "pdf" && (
+ -
+
+
+
+
+ )}
+ {project.type === "googleSlides" && (
+ -
+
+
+
+
+ )}
+
+
+
+ );
+}
export async function getStaticProps() {
const projectsDirectory = path.join(process.cwd(), "public", "projects");
@@ -46,10 +100,10 @@ export async function getStaticProps() {
name: dirent.name,
}))
.sort((a, b) => {
- const order = ['Fall_', 'Winter_'];
+ const order = ["Fall_", "Winter_"];
const getOrderIndex = (dirName) => {
- const prefix = order.find(prefix => dirName.startsWith(prefix));
+ const prefix = order.find((prefix) => dirName.startsWith(prefix));
return prefix ? 0 : 1;
};
@@ -58,17 +112,15 @@ export async function getStaticProps() {
if (orderComparison !== 0) {
return orderComparison;
} else if (getOrderIndex(a.name) === 0) {
- const aNumber = parseInt(a.name.split('_')[1]);
- const bNumber = parseInt(b.name.split('_')[1]);
+ const aNumber = parseInt(a.name.split("_")[1]);
+ const bNumber = parseInt(b.name.split("_")[1]);
return bNumber - aNumber;
} else {
- return a.name.localeCompare(b.name)
+ return a.name.localeCompare(b.name);
}
-
- });;
+ });
const groupedLinks = {};
- const paths = []
subdirectories.forEach((subdirectory) => {
const subdirectoryPath = path.join(projectsDirectory, subdirectory.name);
const innerDirectories = fs
@@ -80,38 +132,38 @@ export async function getStaticProps() {
innerDirectories.forEach((innerDir) => {
const innerDirPath = path.join(subdirectoryPath, innerDir);
-
const writeupMdPath = path.join(innerDirPath, "writeup.md");
const writeupPdfPath = path.join(innerDirPath, "writeup.pdf");
const linkTxtPath = path.join(innerDirPath, "link.txt");
- const label = innerDir.split("_")
- .join(" ");
- let type, href
+ const label = innerDir.split("_").join(" ");
+ let type, href;
if (fs.existsSync(linkTxtPath)) {
- const link = fs.readFileSync(linkTxtPath, 'utf-8').trim();
- href = link
- type = "link"
+ const link = fs.readFileSync(linkTxtPath, "utf-8").trim();
+ if (link.toLowerCase().includes('docs.google.com/presentation')) {
+ href = link;
+ type = "googleSlides";
+ } else {
+ href = link;
+ type = "link";
+ }
} else if (fs.existsSync(writeupMdPath)) {
- href = `/projects/${subdirectory.name}/${innerDir}`
- type = "md"
- }
- else if (fs.existsSync(writeupPdfPath)) {
- href = `/projects/${subdirectory.name}/${innerDir}/writeup.pdf`
- type = "pdf"
+ href = `/projects/${subdirectory.name}/${innerDir}`;
+ type = "md";
+ } else if (fs.existsSync(writeupPdfPath)) {
+ href = `/projects/${subdirectory.name}/${innerDir}/writeup.pdf`;
+ type = "pdf";
} else {
- href = ""
- type = "none"
+ href = "";
+ type = "none";
}
- links.push({ label, href, type })
-
+ links.push({ label, href, type });
});
if (links.length > 0) {
groupedLinks[subdirectory.name.split("_").join(" ")] = links;
}
-
});
return {
@@ -120,4 +172,3 @@ export async function getStaticProps() {
},
};
}
-
diff --git a/public/images/sponsors/umsi.png b/public/images/sponsors/umsi.png
new file mode 100644
index 0000000..26e2b2e
Binary files /dev/null and b/public/images/sponsors/umsi.png differ